Skip to content

Instantly share code, notes, and snippets.

@naazeri
Last active March 5, 2023 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naazeri/e9100834bd2d14cd61c160857520f128 to your computer and use it in GitHub Desktop.
Save naazeri/e9100834bd2d14cd61c160857520f128 to your computer and use it in GitHub Desktop.
import random
numbers = []
def getUniqueRandom(start, end):
while True:
n = random.randrange(start, end)
if n not in numbers:
return n
for i in range(100):
n = getUniqueRandom(1, 500)
numbers.append(n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment