Answers for "apply random function in list python"

5

random from list python

import random

foo = ['a', 'b', 'c', 'd', 'e']
print(random.choice(foo))
Posted by: Guest on March-29-2021
1

which function to use in random module for a list in python

random.choice
Posted by: Guest on May-11-2020

Code answers related to "apply random function in list python"

Python Answers by Framework

Browse Popular Code Answers by Language