ChatGPT does it in two:
for i in range(1, 101): print(“Fizz” * (i % 3 == 0) + “Buzz” * (i % 5 == 0) or i)
for i in range(1, 101):
print(“Fizz” * (i % 3 == 0) + “Buzz” * (i % 5 == 0) or i)
And in one:
print(‘\n’.join([‘Fizz’ * (i % 3 == 0) + ‘Buzz’ * (i % 5 == 0) or str(i) for i in range(1, 101)]))
ChatGPT does it in two:
And in one: