It's been 5 hours trying to find the issue but unable to identify why for loop for fn in L
running infinite.
L=[]
N=int(raw_input())
for i in range(0,N):
L.append(list(raw_input().split()))
print L
for fn in L:
if 'insert'==fn[0]:
L.insert(int(fn[1]),int(fn[2]))
elif 'append'==fn[0]:
L.append(int(fn[1]))
elif 'remove'==fn[0]:
L.remove(int(fn[1]))
elif 'pop'==fn[0]:
L.pop(int(fn[1]))
elif 'index'==fn[0]:
L.index(int(fn[1]))
elif 'count'==fn[0]:
L.count(int(fn[1]))
elif 'sort'==fn[0]:
L.sort()
elif 'reverse'==fn[0]:
L.reverse()
else :
print L
Inputs provided to list:
12
insert 0 5
insert 1 10
insert 0 6
print
remove 6
append 9
append 1
sort
print
pop
reverse
print