The error you are getting because
"TypeError: 'int' object is not iterable" is caused by the statement for num in 4 because the for statement operates on iterable data such as a string, list, tuple, or other object container
What to do:
You need to use i to iterate through a list, but you specified an integer, named len(sequence), instead of the necessary list
So write your program like below:
def count(serial, totals):
found = 0
for i in range(len(serial)):
if serial[i] == totals:
found = found + 1
Hope you understand this .
If you still do not understand fell free to ask me any question.