You are viewing a single comment's thread. Return to all comments →
The shortest code I could come with. I wonder if it could be shorter.
from collections import deque d = deque() for _ in range(int(input())): cmd, *attribute = input().split() eval(f'd.{cmd}({(attribute[0:1] or ('',))[0]})') 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 →
The shortest code I could come with. I wonder if it could be shorter.