QuestionQ153

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

What is the resulting output of the following code?

Question Image

Explanation

Assignment makes list2 refer to the same mutable list as list1. Updating the first element through list1 changes that shared list, so list2 evaluates to [4, 3].

Community Discussion

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