Skip to content

Instantly share code, notes, and snippets.

@santosh
Created May 9, 2018 02:47
Show Gist options
  • Save santosh/5135e9f111be904df16ecc497039f9b6 to your computer and use it in GitHub Desktop.
Save santosh/5135e9f111be904df16ecc497039f9b6 to your computer and use it in GitHub Desktop.
Itertools module test use.
import itertools
for x in itertools.count(50, 5):
print(x)
if x == 80:
break
for x in itertools.count(50):
print(x)
if x == 80:
break
colorsForPainting = ["Red", "Blue", "Yellow", "Green", "Orange", "Purple"]
for c in itertools.combinations(colorsForPainting, 3):
print(c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment