How can I shorten my endless if-statements in this question?
List Operations You are given a 2D matrix, which represents the number of people in a room, grouped by their eye color and gender. The first row represents the male gender, while the second row represents females. The columns are the eye colors, in the following order: brown, blue, green, black. Our program needs to take eye color as input and output the percentage of people with that eye color in the room. data = [ [23, 11, 5, 14], [8, 32, 20, 5] ] My spaghetti code that works: color = input() if color == "brown": color_male = 23 if color == "blue": color_male = 11 if color == "green": color_male = 5 if color == "black": color_male = 14 if color == "brown": color_female = 8 if color == "blue": color_female = 32 if color == "green": color_female = 20 if color == "black": color_female = 5 all_people = color_male + color_female percentage = (all_people/118)*100 print(int(percentage))