0
How can I resolve the program to randomly select from the specified texts?
Example: Texts to choose from: "Hello";"Bye";"Goodbye" Output: Hello
3 Respostas
0
Try this
import random as r
lst=['Hello','Bye','Goodbye']
print(lst[r.randint(0,len(lst))])
+ 6
use random.choice(<iterable>)
+ 1
Thank you guys!! 😁