Hello guys, post your comments, views, and questions here for answers or discussions. Remember, the best comments are those that help build others, those from which everyone or at least someone can learn something new. Happy Pythoning!
Sample. Choose a selection of items from a list randomly. It will not return duplicates unless of course there are duplicates in the list. It's an easy way of selecting multiple items from a list randomly. (Click in the code editor below to view code)
from random import sample names = ["Python", "Java", "Html", "C++", "C#"] chosenPrograms = sample(names, 3) print(chosenPrograms)