Created
August 19, 2017 16:59
-
-
Save CamDavidsonPilon/626c4732e175717f8a8b0e6eb0254c39 to your computer and use it in GitHub Desktop.
This file contains 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 | |
def sequence(): | |
queue = deque([3,3,3,2]) | |
yield queue.popleft() | |
while True: | |
value = queue.popleft() | |
queue.extend([3] * value + [2]) | |
yield value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment