Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8041

MicroPython • Re: Weird modulus problem

$
0
0
The `time.localtime()` function gives you the exact time when you call it, so in the `if` statement it's probably getting called right at the end of the 14:30:59 second for the modulo 2 part (which is %2 so that returns true), then called again at the start of the 14:31:00 second for the equals 0 part (which is at 0 seconds, so the second part also returns true)
Ohh... That does make sense when I think about it. Thank you!

Statistics: Posted by Rander — Fri May 02, 2025 7:15 pm



Viewing all articles
Browse latest Browse all 8041

Trending Articles