I know that I can round to the closest multiple of 10 in python by using round(<int>, -1) Is there a way to do this without using this built in function?
Edit:
Thanks for the feedback! The answer using divmod() was interesting because I had never used divmod before. Just in case anyone wants to know on CodingBat the solution used modulo as was suggested in the comments. Here it is in case anyone is interested.
def round10(num):
mod = num % 10
num -= mod
if mod >= 5: num += 10
return num