"Fractional part : Given a positive real number, print its fractional part." - python coding question

 


 

CODING QUESTION

Given a positive real number, print its fractional part.

SOLUTION

from math import*
a=float(input())
a=a-floor(a)
print(a)

Input : 17.9

Output : 0.8999999999999986