''' Mission 7 - Personal Billboard This project creates a list with three different data types - tuple (color), string and CodeX image It uses a constant for the last index and two buttons for scrolling through the list. ''' from codex import * choice = 0 my_list = [GREEN, "Ahoy", pics.HAPPY, pics.SAD, RED, pics.SURPRISED, "Having a great day", pics.ASLEEP, PINK, pics.TIARA, "Meh", pics.TARGET] LAST_INDEX = len(my_list) - 1 while True: my_image = my_list[choice] if type(my_image) == tuple: display.fill(my_image) else: display.show(my_image) if buttons.was_pressed(BTN_L): choice = choice - 1 if choice < 0: choice = LAST_INDEX if buttons.was_pressed(BTN_R): choice = choice + 1 if choice > LAST_INDEX: choice = 0