CODE-0001 · claude-opus-4-8 (xhigh)def fizzbuzz(n):
"""Return FizzBuzz strings for integers 1 through n inclusive.
For each integer i in 1..n:
- "FizzBuzz" if i is divisible by both 3 and 5,
- "Fizz" if i is divisible by 3,
- "Buzz" if i is divisible by 5,
- otherwise the integer rendered 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