in the divisible by 10 problem in loops , how to use the while loop to get the output.

can some one help in debugging this code.

#Write your function here

def divisible_by_ten(nums):

n=0

count=0

#while n<len(divisible_by_ten):

#or

#while n in range(len(divisible_by_ten)):

if divisible_by_ten[n] %10==0:

count+=1

return count

#Uncomment the line below when your function is done

print(divisible_by_ten([20, 25, 30, 35, 40]))

the error i am getting is ““TypeError: object of type ‘function’ has no len()””

which is happening in while loop declaration

I remember using code like below once but it too seems to give invalid syntax

count=0

def divisible_by_ten(nums):

for n in nums if n%10==0:

```
count+=1
```

return count