Count


#1

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

I didn't use any smart way to code the exercise but it works.
Does it look good?

def count(sequence, item):
    cnt=0
    for num in sequence:
        if num==item:
            cnt+=1
    return cnt

#2

its a good solution :slight_smile: Well done!


#3

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