You are viewing a single comment's thread. Return to all comments →
if __name__ == '__main__': N = int(input()) lst = [] operations = { 'append': lambda x: lst.append(x), 'print': lambda: print(lst), 'remove': lambda x: lst.remove(x), 'insert': lambda i, x: lst.insert(i, x), 'sort': lambda: lst.sort(), 'pop': lambda: lst.pop(), 'reverse': lambda: lst.reverse() } inputs = [input().split() for _ in range(N)] for command in inputs: operations[command[0]](*[int(x) for x in command[1:]])
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 →