Answers for "the python code from an array how to access a random value"

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
1

python random generator from list

import random
n = random.random()
print(n)
Posted by: Guest on June-01-2020

Code answers related to "the python code from an array how to access a random value"

Python Answers by Framework

Browse Popular Code Answers by Language