Created
June 22, 2019 16:22
-
-
Save tmitzka/e85f8e859e0699f62e0149942af72c99 to your computer and use it in GitHub Desktop.
Lotto drawings (6 out of 45)
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
"""Show the number of lotto drawings to win.""" | |
import random | |
LOTTO_POOL = list(range(1, 50)) | |
lucky_numbers = random.sample(LOTTO_POOL, 6) | |
lucky_numbers.sort() | |
my_numbers = [] | |
drawings = 0 | |
while my_numbers != lucky_numbers: | |
my_numbers = random.sample(LOTTO_POOL, 6) | |
my_numbers.sort() | |
print(my_numbers) | |
drawings += 1 | |
print(f"\nLucky numbers:\t{lucky_numbers}") | |
print(f"Drawings:\t{drawings}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment