i am solving the problem: Write a program to input real number a . Print out the integer and odd parts of a.
i used this code in python3:
”’
n = float(input())
print(int(n), n-int(n))
”’
when i input : 1.1
true answer is 1 and 0.1
but my output is 1 and 0.100000009
I don’t know why it is like that
How can I fix this?
New contributor
goodnight is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.