Fun with Fizz Buzz!

using python

one_to_hundred = []
for i in range(100):
    one_to_hundred.append(i)

for i in one_to_hundred:

    if i % 5 == 0 and i % 3 == 0:
        one_to_hundred[int(one_to_hundred.index(i))] = "FizzBuzz"

    if i % 3 == 0:
        if i % 5 == 0 and i % 3 == 0:
            pass
        else:
            one_to_hundred[int(one_to_hundred.index(i))] = "Fizz"

    if i % 5 == 0:
        if i % 5 == 0 and i % 3 == 0:
            pass
        else:
            one_to_hundred[int(one_to_hundred.index(i))] = "Buzz"

print(one_to_hundred)

just swipe towards left to see the full results in companion

FizzBuzz.aia (156.0 KB)

6 Likes