KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Predict the data type of the given Python statement:

a=42.85
b=int(a)
print(type(b))

Python Functions

1 Like

Answer

Output
<class 'int'>
Explanation

The int() function converts the floating-point value 42.85 into an integer 42 by truncating the decimal part. Therefore, the data type of b is int.

Answered By

3 Likes


Related Questions