QuestionQ41

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

Review the snippet and select the true statement:

Question Image

Explanation

Assignment makes nums and vals refer to the same mutable list. Deleting the complete slice with del vals[:] clears that list in place, leaving both references with length 0. Python documents that del a[:] clears a list.

Learn more

Community Discussion

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