-
-
Save mastro35/0213ab08a8335cde300a17b33a9fbec7 to your computer and use it in GitHub Desktop.
This file contains 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
import time | |
import random | |
def get_winning_numbers(): | |
random.seed() | |
for i in range(0,10): | |
time.sleep(1) # let's simulate some kind of delay | |
yield random.randint(1,10) | |
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