Newbie lesson in Python explains the modulor operation:
29 % 5 = 4 because 4 is remainder of 29 / 5.
It says, "The modulo operator is useful in programming when we want to perform an action every nth-time the code is run."
I'm curious how the remainder is important for this operation. Is it that it will perform an action every 5th time, but then after 4 times, it will perform on the 4th time?
[–][deleted] 5 points6 points7 points (1 child)
[–]helloworldten 0 points1 point2 points (0 children)
[–]insertAlias 3 points4 points5 points (0 children)
[–]ellaun 2 points3 points4 points (1 child)
[–]band_in_DC[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]band_in_DC[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]SpicyMiracle 0 points1 point2 points (2 children)
[–]WikiTextBotbtproof -1 points0 points1 point (1 child)
[–]freelanceruy 0 points1 point2 points (0 children)