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