• + 1 comment

    if name == 'main': N = int(input()) lst=[] for i in range(N): command = input().split() match(command[0].lower()): case "insert": lst.insert(int(command[1]), int(command[2]))

            case "print":
                print(lst)
    
            case "remove":
                lst.remove(int(command[1]))
    
            case "append":
                lst.append(int(command[1]))
    
            case "sort":
                lst.sort()
    
            case "pop":
                lst.pop()
    
            case "reverse":
                lst.reverse()
    
            case _:
                print("Invalid Command")