Aug-15-2022, 10:29 AM
Try random.choice() or random.choices()
Maybe read up on weights=, I don't understand it! k=5 gives you 5 results
Maybe read up on weights=, I don't understand it! k=5 gives you 5 results
import random mylist = ["apple", "banana", "mango", "cherry", "pear", "raspberry"] print(random.choices(mylist, weights = None, k = 5))