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