Please, help! I am trying to get my head around the string methods, but it feels like I am missing out on something.
I tought this is one way to solve the "Count"-exercise:
def count(sequence,item): number= for i in sequence: if i==item: number +=1 else: number = number answer=int(number) return answer count
But it did not
Oops, try again. Does your count function take exactly two arguments: a list and an item to check against that list? Your code threw a "'int' object is not iterable" error.
I can better ask for some help... I thought that I made a function with two arguments, ánd that I turned the string into an integer.
Can anybody help me finding out what section of the course I did not understand?
Thank you for your help!!