Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

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

What will be the output of the following Python code?
for i in range(int(2.0)):
print(i)
a) 0.0 1.0
b) 0 1
c) error
d) none of the mentioned

Answer: b
Explanation: range(int(2.0)) is the same as range(2).

Join The Discussion