Home / Engineering / Problem Solving and Python Programming / Question

M

Mr. Dubey • 51.43K Points
Coach

Q.) What will be the output of the following
Python code?
for i in range(2.0):
print(i)

(A) 0.0 1.0
(B) 0 1
(C) error
(D) none of the mentioned
Correct answer : Option (B) - 0 1

Explanation:
 object of type float cannot be interpreted as an integer.

Share

Discusssion

Login to discuss.