Skip to content

Question 9

Evaluate:

(('R', 255), ('G', 0), ('B', 255))[1]
Hint

In here, each inner tuple is considered one element of the larger tuple.

Solution

In (('R', 255), ('G', 0), ('B', 255)),

  • index 0: ('R', 255)
  • index 1: ('G', 0) (this is the answer)
  • index 2: ('B', 255)
Answer
('G', 0)