Robotics & Artificial Intelligence

Python has a built-in type() function to ascertain the data type of a specific value. Predict the data type of the given Python statement:

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

Python Functions

1 Like

Answer

Output
<class 'float'>
Explanation

The float() function converts the integer 32 into a floating-point number 32.0. Therefore, the data type of n is float.

Answered By

1 Like


Related Questions