''' Mission 8 - Answer Bot Mild Remix 1A Create a list of colors and select a random color when button is pressed. This solution turns on all four pixels. ''' from codex import * import random from time import sleep # My list of colors my_colors = [RED, GREEN, BLUE, WHITE, PURPLE, PINK, YELLOW, ORANGE] display.print("A = pixels", scale=3) display.print("D = quit", scale=3) while True: # Display random answer pixel color when # Button A is pressed if buttons.was_pressed(BTN_A): my_choice = random.choice(my_colors) pixels.set(0, my_choice) pixels.set(1, my_choice) pixels.set(2, my_choice) pixels.set(3, my_choice) if buttons.was_pressed(BTN_D): break display.print("Thanks", scale=5)