programming-examples/python/Math/Randomly select an item from a list.py

3 lines
102 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
import random
color = ['Red', 'Green', 'Black', 'Orange', 'Black']
print(random.choice(color))