Print the nearest multiple of 5. In python | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

Print the nearest multiple of 5. In python

Suppose you have given a no. 33 and you have to find the nearest no. That is multiplier of 5

9th Jan 2021, 5:28 PM
Rahul
Rahul - avatar
2 Réponses
+ 2
Think about using the round() function to do this. Divide the number by 5, round it to zero decimal places, then multiply by 5. Done!
9th Jan 2021, 5:45 PM
Brian
Brian - avatar
+ 5
Your attempt is needed Hint : modulo(%) operator can be used to find remainder after division.
9th Jan 2021, 5:32 PM
Arsenic
Arsenic - avatar