How to convert float to int in Python
Converting float to int is type conversion. We can simply do the same using int(). But keep in mind that this type of type conversions can cause loss of data. For example, if we try to convert the float number 5.53 to int, the result will be 5
numb = 4.5 print (type(numb)) num=int(numb) print (type(num))
output:
<class 'float'> <class 'int'>
Subscribe
Login
Please login to comment
0 Discussion