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