Skip to content

Instantly share code, notes, and snippets.

@calebmadrigal
Created February 24, 2015 20:43
Show Gist options
  • Save calebmadrigal/dbcab5928f687668cb32 to your computer and use it in GitHub Desktop.
Save calebmadrigal/dbcab5928f687668cb32 to your computer and use it in GitHub Desktop.
FIFO, LIFO, YOLO
import random
from collections import deque
print("#FIFO")
queue = deque()
for i in range(10):
queue.append(i)
print([queue.popleft() for _ in range(len(queue))])
print("#LIFO")
stack = []
for i in range(10):
stack.append(i)
print([stack.pop() for _ in range(len(stack))])
print("#YOLO")
yolo = list(range(10))
random.shuffle(yolo)
print(yolo)
@TheRealFalcon
Copy link

HAHUHAHEHIHAHUHEHA!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment