''' Python CodeX Midterm: Part C Code created from a flowchart ''' from codex import * from time import sleep delay = 3 # this is added just for testing -- not on flowchart sleep(delay) if buttons.was_pressed(BTN_A): color = GREEN pixels.set([color, color, color, color]) # this code also turns all pixels to color pixels.set(0, color) pixels.set(1, color) pixels.set(2, color) pixels.set(3, color) sleep(delay) if buttons.was_pressed(BTN_A): display.show(pics.HAPPY) else: display.show(pics.SAD)