Skip to content

Instantly share code, notes, and snippets.

@tamuhey
Created January 6, 2019 08:35
Show Gist options
  • Save tamuhey/0d8770b4f9389d9b2f9960577a4d0b5f to your computer and use it in GitHub Desktop.
Save tamuhey/0d8770b4f9389d9b2f9960577a4d0b5f to your computer and use it in GitHub Desktop.
Random sequence generator in Python
def random_generator(step=None):
step = step or random.randint(1e4, 1e5)
for c in count():
for i in random.sample(range(c*step, (c+1)*step), step):
yield i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment