Skip to content

Instantly share code, notes, and snippets.

@zmallen
Created April 6, 2017 23:14
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 zmallen/1b9fc6dd068cd38042f526d4e9d06ca5 to your computer and use it in GitHub Desktop.
Save zmallen/1b9fc6dd068cd38042f526d4e9d06ca5 to your computer and use it in GitHub Desktop.
import random
arr = []
def check_arr(num):
for elem in arr:
if elem == num:
return True
return False
while len(arr) < 5:
num = random.randint(0,30)
if not check_arr(num):
arr.append(num)
print arr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment