• + 0 comments

    arr=[]
    for i in range(N): a=input() a=a.split() if str(a[0])=="insert": arr.insert(int(a[1]),int(a[2])) elif str(a[0])=="print": print(arr)
    elif str(a[0])=="remove": arr.remove(int(a[1])) elif str(a[0])=="append": arr.append(int(a[1])) elif str(a[0])=="sort": arr.sort() elif str(a[0])=="pop": arr.pop()
    elif str(a[0])=="reverse": arr.reverse()