Random Choices
Pick from a list.
Random Choices 🎁
Sometimes we want a surprise from a list, not just a number. Meet random.choice! 🎉
Pick One 👉
random.choice grabs one random item from a list.
import random
fruits = ["apple", "banana", "cherry"]
print(random.choice(fruits))All lessons in this course
- The random Module
- Random Numbers
- Random Choices
- A Fortune Teller