Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can anyone summarize the noticeable difference between list, tuple, dictionary in Python?

A little bit confusion about some data structure in Python.

Could any expert give some rules of thumb in order to help me get out of this mess?

like image 887
Jervis Avatar asked Mar 21 '26 04:03

Jervis


1 Answers

They are all covered in:

Python - Data Structures

  • List - when you have data that has some order
  • Tuple - when ordered data is to be immutable
  • Dictionary - when data is related by key - value pairs
like image 130
Alan Haggai Alavi Avatar answered Mar 22 '26 19:03

Alan Haggai Alavi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!