Robotics & Artificial Intelligence

Predict the output of the following snippet:

m=32
n=float(m)
print(n)

Python Functions

1 Like

Answer

Output
32.0
Explanation

The float() function converts the integer value 32 stored in m into a floating-point number. Hence, the value of n becomes 32.0 which is displayed by the print() statement.

Answered By

1 Like


Related Questions