Identify the correct output of the following Python program. CHARR = [['A',…
2023
Identify the correct output of the following Python program. CHARR = [['A', 'B'], ['C', 'D'], ['E', 'F']] print(CHARR [1] [1])
- A.
'A' / 'A'
- B.
'B' / B
- C.
'C' / 'C'
- D.
'D' / 'D'
Attempted by 1905 students.
Show answer & explanation
Correct answer: D
Correct output: D. Interpret the nested list: CHARR = [['A', 'B'], ['C', 'D'], ['E', 'F']]. CHARR[1] selects the second sublist ['C', 'D'] because indexing starts at 0. CHARR[1][1] selects the second element of that sublist, which is 'D'. Therefore print(CHARR[1][1]) prints the character D (the console shows D without quotes).