What’s a concise way to express a direct correlation between (apple, banana) and (red, yellow). Although it gets the result I need, I’m just not happy with this…
if value == apple:
result = red
elif value == banana:
result = yellow
else:
result = None
Tough to search for, or even work out what to title this question, but I’m sure it’s a basic exercise. Isn’t it?
1 Answer