CODE-0001 · claude-opus-4-8 (max)def fizzbuzz(n):
"""Return FizzBuzz strings for the integers 1 through n inclusive.
For each integer i in the range:
- "FizzBuzz" if i is divisible by both 3 and 5,
- "Fizz" if divisible by 3,
- "Buzz" if divisible by 5,
- otherwise the integer as a string.
If n < 1, an empty list is returned.
"""
result = []
for i in range(1, n + 1):
if i % 15 == 0:
result.append("FizzBuzz")
elif i % 3 == 0:
result.append("Fizz")
elif i % 5 == 0:
result.append("Buzz")
else:
result.append(str(i))
return result