dimanche 5 avril 2020

Lottery Analysis

I'am doing a kind of simulation of lottery analysis through Python. I've tried some methods to get in the correct way but it didn't work weel :') Here is my code:

from random import choice

activator = True
while activator:
    numbers_letters = [5, 4, 7, 9, 0, 'A', 'S', 'H']
    prize_winner = []

    for i in range (0,4):
        selected = choice(numbers_letters)
        prize_winner.append(selected)

    my_tickets = {5, 'S'}

    if print(my_tickets.issubset(prize_winner)) == True:
        print("You win the prize!")
        activator = False
    else:
        count = 0
        count += 1
        continue

print(f"Trying attempt : {count}")

But it lastly come out with an infinite output with True/False, I knew it is dude to the while loop which is not escape well, but i have no idea on how to edit it. Thinking it for an afternoon, hope somebody can help me (QwQ)

Aucun commentaire:

Enregistrer un commentaire