New course! Every coder should learn Generative AI!
Try a free lesson3 Answers
+ 7
import random
ls = [1,2,3,4,5]
// get random item
choice = random.choice(ls)
print(choice)
+ 6
To choose a list item randomly you can:
import random
random.choice(list)
+ 3
Thomas Williams ΛM!N Thanks to both of you