#import the random module import random #The sequence to choose from L = ['Python', 'Javascript', 'Ruby', 'Java', 'PHP', 'C++', 'C#', 'HTML', 'CSS'] #Choose random items from the list print(random.choices(L, k = 3))import random s = ['Apple', 'Orange', 'Banana'] # print any random value from the list s print(random.choice(s)) # output 'Apple' # type of value does not matter s = ['Apple', 'Orange', 'Banana', 13, 3, 1.513, 5413, '1341'] print(random.choice(s)) # output: 1.513#import the random module import random #The sequence to choose from L = ['Python', 'Javascript', 'Ruby', 'Java', 'PHP', 'C++', 'C#', 'HTML', 'CSS'] #Choose random items from the list print(random.choices(L, k = 3))import random mylist = ["apple", "banana", "cherry"] # choose one of the list print(random.choices(mylist)) # ['apple'] # choose one of the list k times print(random.choices(mylist, k = 7)) # ['cherry', 'cherry', 'banana', 'banana', 'cherry', 'cherry', 'banana'] #chose one of the list k times with relative probability acording to weights print(random.choices(mylist, weights = [10, 1, 1], k = 7)) # ['apple', 'apple', 'apple', 'apple', 'banana', 'cherry', 'apple']