Robotics & Artificial Intelligence
Predict the data type of the given Python statement:
m=12E4
print(type(m))
Python Functions
1 Like
Answer
Output
<class 'float'>
Explanation
The value 12E4 represents 12 × 10⁴ = 120000 in scientific (exponential) notation. Numbers written in exponential notation are always treated as floating-point numbers in Python. Hence, the data type of m is float.
Answered By
3 Likes
Related Questions
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))Predict the data type of the given Python statement:
a=42.85 b=int(a) print(type(b))Predict the data type of the given Python statement:
p='10' print(type(int(p)))Predict the data type of the given Python statement:
n=0.0025 print(type(n))