Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- queue = []
- while True:
- cmd = input()
- if cmd == "exit":
- print("bye")
- break
- elif cmd == 'pop':
- print( queue.pop(0) )
- elif cmd == 'front':
- print( queue[0] )
- elif cmd == 'size':
- print( len(queue) )
- elif cmd == 'clear':
- queue.clear()
- print('ok')
- else:
- c, n = cmd.split()
- queue.append(n)
- print('ok')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement