Instantly share code, notes, and snippets.

Embed
What would you like to do?
import time
import random
def get_winning_numbers():
random.seed()
elements = []
for i in range (0,10):
time.sleep(1) # let's simulate some kind of delay
elements.append(random.randint(1,10))
return elements
random.seed()
my_number = random.randint(1,10)
print ("my number is " + str(my_number))
for winning_number in get_winning_numbers():
print(winning_number)
if my_number == winning_number:
print ("you win!")
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment