You are viewing a single comment's thread. Return to all comments →
action_list = { 'insert': 'arr.insert({},{})', 'print': 'print(arr)', 'remove': 'arr.remove({})', 'append': 'arr.append({})', 'sort': 'arr.sort()', 'pop': 'arr.pop()', 'reverse': 'arr.reverse()', } arr = [] for _ in range(int(input())): commands = input() command = commands.split() eval(action_list.get(command[0]).format(*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 →