The 'int' object is not iterative in python

advertisements

I keep getting the error 'int' object is not iterable, but I can't figure out why, any suggestions?

def printMatching(seq1, seq2):
is_match = []
if len(seq1) < len(seq2):
    short_seq = seq1
else:
    short_seq = seq2
for i in len(short_seq):
    if seq1(i) == seq2(i):
        is_match.append(true)
    else:
        is_match.append(false)

def main():
    seq1 = "abaababb"
    seq2 = "aabbaababa"
    printMatching(seq1, seq2)


for i in range(len(short_seq))

You're currently looping over a single number, which is not allowed. range(int) creates a list of values from [0,input).