Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

a list cannot use appendleft but a ____ can. deque string sequence coll…

Question

a list cannot use appendleft but a ____ can. deque string sequence collection

Explanation:

Brief Explanations

In Python, lists do not have an appendleft method. However, deques (double - ended queues) from the collections module have an appendleft method which allows adding elements to the left side of the data structure. Strings are immutable sequences and do not support such operations. Sequences and collections are more general terms and do not inherently have an appendleft method like deques do.

Answer:

A. deque