Count


#1


https://www.codecademy.com/courses/python-intermediate-en-rCQKw/2/1?curriculum_id=4f89dab3d788890003000096#


i don't know what is the problem


def count(sequence , item):
    found =0 
    for item in sequence:
        found+=1
    return found
print count("ahcfhdsrdsaajhvgaaga","a")


#2

now i know the right code
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
def count(sequence , item):
found =0
for char in sequence:
if char == item :
found+=1
return found
print count("ahcfhdsrdsaajhvgaaga","a")


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.