Skip to content

Instantly share code, notes, and snippets.

@tmitzka
Created June 22, 2019 16:22
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 tmitzka/e85f8e859e0699f62e0149942af72c99 to your computer and use it in GitHub Desktop.
Save tmitzka/e85f8e859e0699f62e0149942af72c99 to your computer and use it in GitHub Desktop.
Lotto drawings (6 out of 45)
"""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