We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Here is my attempt. 'args' can be of any length(0 or more).
from collections import deque
d = deque()
for _ in range(int(input())):
cmd, *args = input().split()
getattr(d, cmd)(*args)
[print(x, end=' ') for x in d]
Collections.deque()
You are viewing a single comment's thread. Return to all comments →
Nice one!
Here is my attempt. 'args' can be of any length(0 or more).