Libraries - random Flashcards
1
Q
blue, yellow, red
Assign a one of the colors above randomly to the variable “color”
A
import random
color = random.choice([“white”, “yellow”, “purple”, “red”])
Python > Libraries - random > Flashcards
blue, yellow, red
Assign a one of the colors above randomly to the variable “color”
import random
color = random.choice([“white”, “yellow”, “purple”, “red”])