Home / Engineering / Problem Solving and Python Programming / Question

M

Mr. Dubey • 51.17K Points
Coach

Q.) What will be the value of the following
Python expression?
float(4+int(2.39)%2)

(A) 5.0
(B) 5
(C) 4.0
(D) 4
Correct answer : Option (C) - 4.0

Explanation:
 the above expression is an example of explicit conversion. it is evaluated as: float(4+int(2.39)%2) = float(4+2%2) = float(4+0) = 4.0. hence the result of this expression is 4.0.

Share

Discusssion

Login to discuss.