Answers for "random choice py"

23

how to randomly choose from a list python

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

random.choice

import random

numberList = [111,222,333,444,555]
print("random item from list is: ", random.choice(numberList))
Posted by: Guest on May-11-2020
1

pick a random number from a list in python

import random

numberList = [1,2,3,4,5]
print(random.choice(numberList))    # Prints a random number from the list
Posted by: Guest on November-27-2020
0

random.choice

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

Python Answers by Framework

Browse Popular Code Answers by Language