Answers for "Which of the following functions randomly selects one item in a list? a. choice() b. shuffle() c. lrandom() d. randomitem()"

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

Code answers related to "Which of the following functions randomly selects one item in a list? a. choice() b. shuffle() c. lrandom() d. randomitem()"

Python Answers by Framework

Browse Popular Code Answers by Language