0% found this document useful (0 votes)
20 views1 page

Data Structures - Python 3.9.7 Documentation. (N.D.) - Python Documentation. Retrieved

Tuples and lists are data types that store ordered collections of data. Tuples are more memory efficient than lists because tuples are immutable and fixed in size, while lists require more memory but are more versatile.

Uploaded by

Renato
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views1 page

Data Structures - Python 3.9.7 Documentation. (N.D.) - Python Documentation. Retrieved

Tuples and lists are data types that store ordered collections of data. Tuples are more memory efficient than lists because tuples are immutable and fixed in size, while lists require more memory but are more versatile.

Uploaded by

Renato
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Tuples and lists are data types that are used to store an ordered collection of data.

They both are

heterogeneous and sequential data types, meaning that they can both store any type of data that can be

iterated, and finally, they can be accessed by an index operator.

The main difference between lists and tuples is that tuples are more memory efficient than lists. That is

because tuples are immutable and fixed on size. Python, when dealing with lists, must allocate an extra

memory block in case there is a need for extend the size of the list.

In conclusion, tuples are faster than lists, but they are immutable; lists require more memory, but they

are more versatile.

References:

5. Data Structures — Python 3.9.7 documentation. (n.d.). Python Documentation. Retrieved

September 11, 2021, from https://docs.python.org/3/tutorial/datastructures.html

GeeksforGeeks. (2021, March 17). Python | Difference Between List and Tuple.

https://www.geeksforgeeks.org/python-difference-between-list-and-tuple/

Isbilen, E. (2021, January 26). Python Tuples: When to Use Them Over Lists - Towards Data

Science. Medium. https://towardsdatascience.com/python-tuples-when-to-use-them-

over-lists-75e443f9dcd7

You might also like