In Python, how would I figure out if the number ends with 0 (10, 20, 30, 40)? I am implementing a system that loops through 24 hours in 24 hours format with 10 minutes intervals but no time library seems to provide time only solutions and it seems that it requires me to input a date and time as string instead of only time.
Asked
Active
Viewed 813 times
1
-
1`num % 10 == 0` – Barmar May 21 '18 at 22:03
-
The `%` is the modulo operator. It does division and returns the *remainder*. So `35 % 3 = 5` while`40 % 10 = 0` – divibisan May 21 '18 at 22:05
-
That's surprisingly simple, thanks guys! – May 21 '18 at 22:06
-
Modulo, modulo, need to understand that. – May 21 '18 at 22:06