Created
September 9, 2020 01:27
-
-
Save bengalih/a7d929140884948495860a2d73475e42 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
from random import sample | |
picked_numbers = sample(range(1,11),4) | |
print(f'Lotto numbers are: {picked_numbers}') | |
no_match = True | |
attempts = 0 | |
while no_match: | |
matches = 0 | |
attempts += attempts + 1 | |
my_numbers = sample(range(1,11),4) | |
for number in my_numbers: | |
if number in picked_numbers: | |
matches += 1 | |
else: | |
continue | |
if matches == 4: | |
print(f'It took {attempts} attempts to pick {my_numbers}!') | |
no_match = False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment