Answer the question
In order to leave comments, you need to log in
How to make a team with a "chance"?
Need code for discord bot. A command that, with some chance, will produce a different answer. For example:
if message.content.startswith('$lol'):
await message.channel.send(f' {message.author.mention} lil')
Answer the question
In order to leave comments, you need to log in
https://docs.python.org/3/library/random.html?high...
>>> import random
>>>
>>> vars = ['yes', 'no']
>>> random.choices(vars, weights=[0.9, 0.1])
['yes']
>>> random.choices(vars, weights=[0.9, 0.1])
['yes']
>>> random.choices(vars, weights=[0.9, 0.1])
['no']
>>> random.choices(vars, weights=[0.9, 0.1])
['yes']
>>> random.choices(vars, weights=[0.9, 0.1])
['yes']
>>>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question