for n in range(1, 100)
w = ''
if not (n % 3) w = 'fizz'
if not (n % 5) w += 'buzz'
print(w or n)
I like this version because it demonstrates variable definition, operator precedence, and logical evaluation in Python as well as operation and assignment.
https://en.wikipedia.org/wiki/Fizz_buzz
https://www.amazon.com/Fizz-Buzz-Spoken-Numeracy-Games/dp/18...
I like this version because it demonstrates variable definition, operator precedence, and logical evaluation in Python as well as operation and assignment.