Count


#1

i defined function, and assignee count to found as per hit. Could any one tell me where my code went wrong?


#2

`
You need to start with a counting variable and set it to zero:
Your_counting_variable = 0
Then iterate through the sequence:
For n in sequence:
Then add 1 to your_counting_variable if the item is at the nth location in the sequence
if n == item:
your_counting_variable += 1


#3

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