Count is not working


def count(sequence,item):
for x in sequence:
if x==item:
return c
it pops an error;
Your function fails on count([1],7). It returns None when it should return 0.
can some body please help me soon


if you edit/update your question, leave a reply so i get a notification. please use the following instructions so we can see your indention (which is crucial in python):

select your code and press ctrl + k (or cmd + k if you use a mac)

if this instructions are unclear, you can also insert 3 backticks before and after your code, like so:


the backtick is located above the tab key on your keyboard

Your code is fine if indented correctly, so i guess you have a indent problem


i got it thankyou very much


Check the location of your return. You are returning inside the if statement so it only returns if the statement is true.


your return is not indented correctly. it now returns after one loop statement. Return should be at the same line as the for loop


that where 1 edit, and 2 reply's within 3 seconds, good you resolved it!