Python HackerRank|Collections.deque()(from collections import deque)

  1. Dashboard 
  2.  Python 
  3.  Collections 
  4.  Collections.deque()
    1. from collections import deque
      
      d = deque()
      for _ in range(int(input())):
          temp = input().split()
          dem, arg = temp[0], temp[1:]
          if not arg:
              eval('d.' + dem + '()')
          else:
              eval('d.' + dem + '(' + str(*arg) + ')')
              
      print(*d)


你可能感兴趣的:(Python)