Collections.deque()

  • + 0 comments

    Here is my code

    from collections import deque
    
    q = deque()
    for _ in range( int(input()) ):
        operation, *value = input().split()
        # print(operation, value)
        method = getattr(q, operation)
        method(*value)
    
    print(*q)