Skip to content
Sign upLog in
← Back to Community
How to round
Profile icon
ArmedWithStew

How do you round a number in python? For example, say I have 5.85. I round up to 6. How do you do that in python?

Voters
Profile icon
OumarouDiallo1
Profile icon
GianfrancoCamp1
Profile icon
MariaGhobros
Profile icon
PaolaLomeli
Profile icon
Yuki886
Profile icon
EmersonSelden
Profile icon
IsabelleKenders
Profile icon
ArmedWithStew
Comments
hotnewtop
Profile icon
ash15khng

https://realpython.com/python-rounding/
This website could probably help you out. For your example you could probably use math.ceil.