Created
May 26, 2017 01:02
-
-
Save richo/d87014e7d4e0060947f57bc80d9653de to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/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