Answers for "get random of array in function return python return 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 choose sample from list with replacement

import random

random.choices(list, k = 4)
Posted by: Guest on May-25-2020

Code answers related to "get random of array in function return python return value"

Python Answers by Framework

Browse Popular Code Answers by Language