You are viewing a single comment's thread. Return to all comments →
this works now
if __name__ == '__main__': N = int(input()) result = [] for n in range(N): x = input().split(" ") command = x[0] if command == 'append': result.append(int(x[1])) if command == 'print': print(result) if command == 'insert': result.insert(int(x[1]), int(x[2])) if command == 'reverse': result = result[::-1] if command == 'pop': result.pop() if command == 'sort': result = sorted(result) if command == 'remove': result.remove(int(x[1])) # print(result)
Seems like cookies are disabled on this browser, please enable them to open this website
Equal
You are viewing a single comment's thread. Return to all comments →
this works now