QuestionQ171

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

What is the expected outcome when the following code is run?

Question Image

Explanation

The list’s first element is updated in place by adding -1 to its original value of 2, producing 1. The final print statement therefore outputs 1.

Community Discussion

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