5 ms·
It prints a substring from "Fizz" using slicing. The thing is, the x%3*4 determines the start of that slice. It's either 0, which is when X modulo 3 == 0 (which
by Wicher 14y ago
It prints a substring from "Fizz" using slicing.
The thing is, the x%3*4 determines the start of that slice. It's either 0, which is when X modulo 3 == 0 (which is every third number in range(101) ), or something larger than 4, in which case the slice would start at the end of "Fizz" thus yielding an empty string.