Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite0
How I can round numbers?
I know i can use round() but I want to round 64 to 60 or 90 to 100. How i can do this?
2 Réponses
+ 3
Bartosz Bryniak Use negative numbers on second argument.
print(round(64, -1))
>> 60
print(round(90, -2))
>> 100