Skip to content

Instantly share code, notes, and snippets.

@richo
Created May 26, 2017 01:02
Show Gist options
  • Save richo/d87014e7d4e0060947f57bc80d9653de to your computer and use it in GitHub Desktop.
Save richo/d87014e7d4e0060947f57bc80d9653de to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import random
def get_10_random_numbers():
lst = []
while True:
elem = random.randint(1, 10)
if elem not in lst:
lst.append(elem)
if len(lst) == 10:
return lst
print(get_10_random_numbers())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment