Python random.choices() Function

PHOTO EMBED

Tue Jun 18 2024 03:28:36 GMT+0000 (Coordinated Universal Time)

Saved by @pynerds #python

#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))
content_copyCOPY

https://www.pynerds.com/python-random-choices-function/