Skip to content

Instantly share code, notes, and snippets.

@bengalih
Created September 9, 2020 01:23
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 bengalih/1cba74f8ad65edfd34a87e210efc6bb2 to your computer and use it in GitHub Desktop.
Save bengalih/1cba74f8ad65edfd34a87e210efc6bb2 to your computer and use it in GitHub Desktop.
from random import sample
import collections
picked_numbers = sample(range(1,11),4)
my_numbers = sample(range(1,11),4)
print(f'Lotto numbers are: {picked_numbers}')
attempts = 0
while collections.Counter(picked_numbers) != collections.Counter(my_numbers):
my_numbers = sample(range(1,11),4)
attempts += 1
print(f'It took {attempts} attempts to pick {my_numbers}!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment