0Pricing
Coding for Kids · Lesson

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

  1. The random Module
  2. Random Numbers
  3. Random Choices
  4. A Fortune Teller
← Back to Coding for Kids