Skip to content

Instantly share code, notes, and snippets.

@MattWoodhead
Created June 24, 2017 11:42
Show Gist options
  • Save MattWoodhead/09b9054438a192f8b57d1ab2d2e11676 to your computer and use it in GitHub Desktop.
Save MattWoodhead/09b9054438a192f8b57d1ab2d2e11676 to your computer and use it in GitHub Desktop.
Itertools cylcle example. All hail Raymond H!
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