Fizzbuzz Answer not being accepted

This code for fizz buzz seems to work perfectly fine, I have tried it and it seems to work perfectly but they refuse to accept my answer, what am I missing/doing wrong?

def fizzbuzz(limit): numbers_list = [] i = 0 for i in range(limit): i+=1 if i % 3 == 0 and i % 5 == 0: numbers_list.append("FizzBuzz") elif i % 3 == 0: numbers_list.append("Fizz") elif i % 5 == 0: numbers_list.append("Buzz") else: numbers_list.append(i) print(str(numbers_list)) fizzbuzz(30)

Hey @py1802326620 welcome to the forums.

Can we have a link to the lesson?

https://www.codecademy.com/code-challenges/code-challenge-fizzbuzz-python here

I think you have to return the array in the function, not print it to the screen.

1 Like

works, thanks a lot!