Created
April 7, 2017 09:23
-
-
Save abhinavkorpal/5a7e5864a4d0c4f753aee9761b3349b6 to your computer and use it in GitHub Desktop.
Collections.deque
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from collections import deque | |
| d = deque() | |
| for _ in range(int(input())): | |
| inp = input().split() | |
| getattr(d, inp[0])(*[inp[1]] if len(inp) > 1 else []) | |
| print(*[item for item in d]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment