Where is the bug in my code?

Hi! My code was:

#Write your function here
number_of_divbytens = []
def divisible_by_ten(nums):
  for x in nums:
    if x % 10 == 0:
      number_of_divbytens.append(x)
  return len(number_of_divbytens)

#Uncomment the line below when your function is done
print(divisible_by_ten([20, 25, 30, 35, 40]))

It returned 3, but the exercise kept telling me that it returned 6. I even added a couple more numbers at the end of the list to make sure that it was working properly. What’s wrong?

The bug really starts to show when we add another function call:

#Write your function here
number_of_divbytens = []
def divisible_by_ten(nums):
  for x in nums:
    if x % 10 == 0:
      number_of_divbytens.append(x)
  return len(number_of_divbytens)

#Uncomment the line below when your function is done
print(divisible_by_ten([20, 25, 30, 35, 40]))
print(divisible_by_ten([33, 44, 80, 47, 98]))

for the second function call, i would expect 1, except i got 4.