0

Tuple vs List

Which one is better

22nd Jul 2019, 12:48 PM
Ashish Raj
Ashish Raj - avatar
3 Antworten
+ 5
List can be change but tuple cannot For more information https://data-flair.training/blogs/python-tuples-vs-lists/
22nd Jul 2019, 12:59 PM
Yash🏁🔘
Yash🏁🔘 - avatar
+ 1
Depend on what you are using it for. List can be manipulated, meaning you can insert stuff at a particular index, pop and append. For tuple, you can add them together e.g. (1,2) + (3,4), otherwise, you cannot change anything unless you are defining a new variable. I would suggest using list since you can manipulate the same variable over again.
22nd Jul 2019, 4:41 PM
Dana Ong
Dana Ong - avatar
0
Tuples are faster I think but they are not mutable like typical lists
24th Jul 2019, 9:15 PM
Az Rael
Az Rael - avatar