I have a nested list and char variable:
colors = [
("r", [255,0,0]),
("g", [0,255,0]),
("b", [0,0,255]),
("y", [255,0,0]),
("p", [255,0,255])
]
char_to_check="b"
How can I (in the most efficient way) check:
1. if char_to_check exists in nested list colors index (r, g, b, etc..)
and
2. if exists (char_to_check) provide values for this char from colors (for example 255,0,0)
else return error (any kind)
dictwith your chars as keys :)