Benefit of using a tuple instead of a list? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 2

Benefit of using a tuple instead of a list?

Based on the Python course here it sounds like a tuple is just a list you can't change? So what would the advantages of using a tuple be?

23rd Dec 2019, 6:10 PM
moth
moth - avatar
7 Réponses
+ 6
I'm not an expert, but the two biggest advantages are: 1. Faster 2. Fixed Memory Size
23rd Dec 2019, 6:29 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 2
By the way Good Question.
23rd Dec 2019, 6:31 PM
Daud Semab
Daud Semab - avatar
+ 2
Aymane Boukrouh [Unavailable] Daud Semab awesome, thanks both of you!
23rd Dec 2019, 6:33 PM
moth
moth - avatar
+ 2
Gamal Kassem Farouk that is just a convention, not a property.
23rd Dec 2019, 10:15 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
0
List can contain data of the same type but tuple can contain data of Many types
23rd Dec 2019, 9:51 PM
Gamal Kassem Farouk
0
According to me tuple is mostly used where we need a unique identity like our account number it neither changed nor similar to other ones.
25th Dec 2019, 2:00 PM
Ravi