Created
June 24, 2017 11:42
-
-
Save MattWoodhead/09b9054438a192f8b57d1ab2d2e11676 to your computer and use it in GitHub Desktop.
Itertools cylcle example. All hail Raymond H!
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
import itertools | |
a = itertools.cycle(range(3)) | |
letters = "ABCDEFG" | |
for num, alpha in zip(a, letters): | |
print(f"{num} - {alpha}") # f-strings are awesome |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment