+ 1
Import random
How to choose one random item in Python between multiple strings? random.randint is for numbers random._______ is for String???
4 Réponses
+ 4
random.choice(iterable) will return a random item from the iterable. if your strings are in an iterable, it should work.
0
what do you mean by multiple string?
0
2 or 3 or ... string
Thanks very much🙌🙌🙌
0
Are you trying to return a random character from a string or return a random word from a sentence/phrase?