fb pixel

Digits after the decimal point

It’s also possible to convert floating-point variables to integers by removing everything that comes after the decimal point. To do that we can write:
num = 43243.6350207935
res = int(num)
print(res, num)
This program would print 43243 43243.6350207935. So, the res is an integer, while num is a floating-point value.
 

Challenge

Given a floating-point number, remove the digits before the decimal point.
Input
Output
875.2345
0.2345
57351.976
0.976
 
To check your solution you need to sign in
Sign in to continue