-2

If I print 5/4 I get 1.25. How do I just get the .25 part.

print(5/4)
1.25 
sg2019
  • 39
  • 4
  • 5
    Does this answer your question? [How to get numbers after decimal point?](https://stackoverflow.com/questions/3886402/how-to-get-numbers-after-decimal-point) – michjnich Feb 19 '20 at 20:08
  • This sounds like an X/Y problem -- what are you actually trying to do? It's almost certainly not to get the number to the right of the decimal (which would be `25`) – Adam Smith Feb 19 '20 at 20:08
  • Can you use `5/4 % 1` ? – Ed Ward Feb 19 '20 at 20:10

1 Answers1

2

Not the most elegant solution but this will work

print(5/4-5//4)
KILLtheWEEZEL
  • 268
  • 1
  • 7