Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: UTF-8 -*-
- __author__ = 'Julio Tentor <jtentor@fi.unju.edu.ar>'
- from _collections import deque
- import random
- print("Demo Queue - versión módulo deque")
- queue1 = deque()
- queue2 = deque()
- number = 0
- character = 'a'
- print("Enqueuing...")
- for c in range(10):
- number = random.randrange(-5000, 5001)
- queue1.append(number)
- character = chr(random.randrange(65, 90))
- queue2.append(character)
- print(number, character, end=" ")
- print()
- print("Dequeuing...")
- while(len(queue1) > 0):
- print(queue1.popleft(), queue2.popleft(), end=" ")
- print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement