Answer the question
In order to leave comments, you need to log in
How to make it so that when you click on the button, some message from the list will fly out with a chance?
For example: I click on the open button
Something from the list drops out with some chance
Nothing dropped (65%)
You got 200 currency (25%)
You got 500 currency (10%)
You got 1500 currency (5%)
You got 10000 currency (1%) (changed)
Answer the question
In order to leave comments, you need to log in
import random
ListOfPrize = ["ничего", "200", "100", "50"]
print(random.choices(ListOfPrize, weights=(65,25, 10, 0.05)))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question