Simple solution using modulo arithmetic and arrays. Relies on python shorthands that hides implicit branches for the number case though.
def main():
fizz_array = ["Fizz", "", ""]
buzz_array = ["Buzz", "", "", "", ""]
for n in range(1, 101):
# Use modulo to index into arrays
f = fizz_array[n % 3]
b = buzz_array[n % 5]
# Combine fizz and buzz
result = f + b
output = result + str(n)[len(result):]
print(output)
main()
I couldn't figure out this line and had to rely on AI for it. output = result + str(n)[len(result):]