# Pick an item randomly chosen = random.choice([1, 2, 3])
# Print out the chosen item print(chosen)
The choice method can be used not only with Python lists, but also with other sequences such as tuples and strings.
Learn Flask development and learn to build cool apps with our premium Python course on Udemy.
We will keep you Python-motivated if you subscribe below.