You are viewing a single comment's thread. Return to all comments →
if name == 'main': N = int(input()) l = list()
for _ in range(N): command= input().split() if command[0]=="insert": i = int(command[1]) e = int(command[2]) l.insert(i,e) elif command[0]=="print": print(l) elif command[0]=="remove": l.remove(int(command[1])) elif command[0]=="append": l.append(int(command[1])) elif command[0]=="sort": l.sort() elif command[0]=="pop": l.pop() elif command[0]=="reverse": l.reverse()
Seems like cookies are disabled on this browser, please enable them to open this website
Lists
You are viewing a single comment's thread. Return to all comments →
if name == 'main': N = int(input()) l = list()