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(float(‘inf’)):
print (i)

What will be the output of the following Python code?
for i in range(float(‘inf’)):
print (i)
a) 0.0 0.1 0.2 0.3 …
b) 0 1 2 3 …
c) 0.0 1.0 2.0 3.0 …
d) none of the mentioned

Answer: d
Explanation: Error, objects of type float cannot be interpreted as an integer.

Join The Discussion