Answers for "random valuesfrom list python"

23

how to randomly choose from a list python

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

python random list

import random
#Generate 5 random numbers between 10 and 30
# sample number needs to be smaller than population
randomlist = random.sample(range(10, 30), 5)
print(randomlist)
Posted by: Guest on December-03-2020

Python Answers by Framework

Browse Popular Code Answers by Language