SyntaxFix
Write A Post
Hire A Developer
Questions
This will round down correctly as well:
>>> n = 46 >>> rem = n % 10 >>> if rem < 5: ... n = int(n / 10) * 10 ... else: ... n = int((n + 10) / 10) * 10 ... >>> 50