Created
January 6, 2019 08:35
-
-
Save tamuhey/0d8770b4f9389d9b2f9960577a4d0b5f to your computer and use it in GitHub Desktop.
Random sequence generator in Python
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 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