You are viewing a single comment's thread. Return to all comments →
if __name__ == '__main__': N = int(input()) l=[] for i in range(N): n = input().split() cmd = n[0] if cmd == 'insert': l.insert(int(n[1]),int(n[2])) elif cmd == 'print': print(l) elif cmd == 'remove': l.remove(int(n[1])) elif cmd == 'append': l.append(int(n[1])) elif cmd == 'sort': l.sort() elif cmd == 'pop': l.pop() elif cmd == '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 →