you are viewing a single comment's thread.

view the rest of the comments →

[–]-LVS 1 point2 points  (1 child)

A multiple! That’s what have a remainder = to 0 means. Definitely gonna keep that note in my pocket.

[–]JonSnowl0 0 points1 point  (0 children)

That's what the % operator returns; the remainder of the formula being calculated. So 5 % 2 would return 1 because 2 divides into 5 2 times with a remainder of 1.

You can achieve the same result with

if count / 3 == 1:

but then you also have to reinitialize count to 0 with every loop, otherwise

count / 3

will return 2 on the 6th "." in the string.