Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def kiir(adat):
- return ', '.join(str(x) for x in sorted(int(x) for x in adat))
- print("Üdvözlünk a lottójátékban!")
- print("Tippelj 5 számot 1 és 90 között!")
- lotto_szamok = [str(x) for x in range(1, 91)]
- tippek = set()
- while len(tippek) < 5:
- tip = input(f"{len(tippek)+1}. tipp: ")
- if tip in lotto_szamok:
- tippek.add(tip)
- huzott_szamok = set(random.sample(lotto_szamok, 5))
- print(f"Huzott szamok: {kiir(huzott_szamok)}")
- print(f"Tippek: {kiir(tippek)}")
- if len(huzott_szamok & tippek) > 0: #van találat?
- print(f"Talalat: {kiir(huzott_szamok & tippek)}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement