0

A= " % . 2f " %(5.856)

Above code returns 5.85 as a string but I can't able to convert it into integer why

21st Dec 2019, 2:22 PM
Muralikrishnan
Muralikrishnan - avatar
1 Réponse
+ 2
Try this: # Output: 5 print(" %.0d " %(5.856)) # Output: 6 print(" %.0f " %(5.856))
21st Dec 2019, 2:46 PM
Coding Cat
Coding Cat - avatar