D
D
Danila Danilov2020-06-16 09:08:20
Python
Danila Danilov, 2020-06-16 09:08:20

Python. Outputting random words from multiple lists?

Hello. There is such a problem: there is a code with 15 lists of words. It is necessary to display the result of randomness in a separate window. How to do it?
And how to add a clickable button in this window, which will be responsible for starting the script?
If needed, I can attach the code.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2020-06-16
@dmtrrr

In [28]: l3 = ["ww", "zz"]

In [29]: l1 = ["aa", "bb"]

In [30]: l2 = ["cc", "dd"]

In [31]: l3 = ["ww", "zz"]

In [32]: from random import choice

In [33]: choice(l1 + l2 + l3)
Out[33]: 'zz'

In [34]: choice(l1 + l2 + l3)
Out[34]: 'dd'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question