QuestionQ17

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

What is the expected output from the following code?

Question Image

Explanation

The outer list has only two elements, with valid indices 0 and 1. Indexing it at 2 raises an IndexError, so the code terminates with an error rather than printing a number.

Community Discussion

No comments yet. Be the first to start the discussion!