Created
July 29, 2015 12:25
-
-
Save sillyfellow/ea2eb99e996cc481ac0e 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
def cons(list, count): | |
if count <= 0: | |
count = 1 | |
for i in range(len(list) - count + 1): | |
yield list[i: i+count] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment