18
Aug
Learn how to select element from python list randomly
You have to include ‘from random import choice’ line.
mylist = [‘z’, ‘y’, ‘x’, ‘v’, ‘u’]
from random import choice
print choice(mylist)
You have to include ‘from random import choice’ line.
mylist = [‘z’, ‘y’, ‘x’, ‘v’, ‘u’]
from random import choice
print choice(mylist)