Post
Python
How can I resolve the error “‘int’ object is not iterable” in python?
I am working on the counting problem which is showing me the error here is the code:
def count(seq, itm):
found = 0
for j in len(sequence):
if seq[j] == itm:
found = found + 1
return found
Posted on 18th April 2024
You just forgot to use range in the for loop modify the for loop like this, and it will work
For j in range(len(sequence))
STILL GOT QUERIES?