Answer the question
In order to leave comments, you need to log in
How to generate random text from words in a list?
Can you tell me which script is better to use to generate text from the list?
Let's say here is our list of a few words:
list = ["привет", "приветик", "надеюсь у вас всё хорошо", "лучше некуда"]
Hello, I hope you are doing well
Answer the question
In order to leave comments, you need to log in
list = ["hello", "hello", "hope you're doing well", "the best"]
import random
_list = ["привет", "приветик", "надеюсь у вас всё хорошо", "лучше некуда"]
random.shuffle(_list)
helloString = ' '.join(_list)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question