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