QuestionQ15

VerifiedPython/PyEZ

Append, pop, and sort are all methods used to manipulate which Python data structure?

Explanation

In Python, lists are mutable sequences that provide built-in methods such as append() to add an element to the end, pop() to remove and return an element (by default the last one), and sort() to order the elements in place. Dictionaries and tuples do not support this same set of operations (tuples are immutable and lack these methods, and dictionaries lack append() and sort()), so lists are the data structure being manipulated.

Learn more

Community Discussion

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