Why tuples are faster than list in python?

Python

Could someone tell me why Tuples are faster than List in Python?


If you want to unleash your potential in this competitive field, please visit the Python course page for more information, where you can find the Python tutorials and Python frequently asked interview questions and answers as well.

1
Answers

Replies

The tuples will be stored in a single block of memory and are immutable. This further helps the tuples from requiring the extra spaces to store the new objects. Lists will be allocated in the two blocks of memory which will take more space to store the new objects.

 
 

This topic has been locked/unapproved. No replies allowed

Login to participate in this discussion.

Leave a reply

Before proceeding, please check your email for a verification link. If you did not receive the email, click here to request another.
WhatsApp
To Top