Answers for "python print random item from list"

12

how to print a random part of a list in python

import random

foo = ['a', 'b', 'c', 'd', 'e']
print(random.choice(foo))
Posted by: Guest on April-08-2020
23

how to randomly choose from a list python

random.choice(name of list)
Posted by: Guest on December-04-2019

Code answers related to "python print random item from list"

Python Answers by Framework

Browse Popular Code Answers by Language