You are viewing a single comment's thread. Return to all comments →
Cool getattr solution:
from collections import deque n= int(input()) d = deque() for _ in range(n): command_line = input().split() command = command_line[0] arguments = command_line[1:] getattr(d, command)(*arguments) print(*d)
Seems like cookies are disabled on this browser, please enable them to open this website
Collections.deque()
You are viewing a single comment's thread. Return to all comments →
Cool getattr solution: