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