Free tutorials & notes in Hindi & English · Clean code examples · Mobile friendly learning
Free tutorials in Hindi & English Daily computer, mobile and IT guides Beginner friendly learning
Blog · Python · 04 Jul 2026 · Hindi + English

Python में List और Tuple में अंतर (Table + Examples)

List mutable है, tuple immutable — लेकिन interviewers 6 और अंतर expect करते हैं. Memory और speed proof के साथ पूरी comparison table.

The one-line answer

List is mutable (can be changed after creation), tuple is immutable (locked after creation). List uses [ ], tuple uses ( ). But interviews expect more — here are all 7 differences.
my_list  = [10, 20, 30]     # list  - square brackets
my_tuple = (10, 20, 30)     # tuple - round brackets

my_list[0]  = 99            # OK: list changed
my_tuple[0] = 99            # TypeError: 'tuple' object does not
                            # support item assignment

Full comparison table (7 differences)

PointListTuple
MutabilityMutable — add/remove/changeImmutable — locked forever
Syntax[1, 2, 3](1, 2, 3)
Methods11+ (append, remove, sort...)Only 2 (count, index)
SpeedSlowerFaster (fixed size)
MemoryMore (extra space for growth)Less (exact fit)
Dictionary key❌ Cannot be a dict key✅ Can be a dict key
Use caseData that changes (cart items)Fixed data (coordinates, dates)

Memory proof (run this yourself)

import sys

l = [10, 20, 30, 40, 50]
t = (10, 20, 30, 40, 50)

print("List size :", sys.getsizeof(l), "bytes")
print("Tuple size:", sys.getsizeof(t), "bytes")
List size : 104 bytes Tuple size: 80 bytes

Same 5 items, tuple takes less memory — because a list reserves extra space for future growth, a tuple never grows.

The dictionary-key difference (interview favourite)

locations = { (28.61, 77.20): "Delhi" }     # tuple key: OK
print(locations[(28.61, 77.20)])

wrong = { [28.61, 77.20]: "Delhi" }         # TypeError:
                                            # unhashable type: 'list'
Delhi

Only immutable objects can be dictionary keys. Since a tuple cannot change, Python can hash it; a list can change, so it cannot be hashed.

When to use which?

  • Use a list when data will change: shopping cart, student attendance, todo items.
  • Use a tuple when data must never change: (latitude, longitude), RGB colours, date of birth, function returning multiple values.
  • Interview line: "Tuple is a read-only list — safer, faster and hashable."

One-line answer

List mutable है (बनने के बाद बदल सकती है), tuple immutable है (बनने के बाद locked). List [ ] use करती है, tuple ( ). लेकिन interviews में और expect किया जाता है — यहां सभी 7 अंतर हैं.
my_list  = [10, 20, 30]     # list  - square brackets
my_tuple = (10, 20, 30)     # tuple - round brackets

my_list[0]  = 99            # OK: list बदल गई
my_tuple[0] = 99            # TypeError: 'tuple' object does not
                            # support item assignment

पूरी comparison table (7 अंतर)

PointListTuple
MutabilityMutable — add/remove/changeImmutable — हमेशा के लिए locked
Syntax[1, 2, 3](1, 2, 3)
Methods11+ (append, remove, sort...)सिर्फ 2 (count, index)
Speedधीमीतेज़ (fixed size)
Memoryज़्यादा (growth के लिए extra space)कम (exact fit)
Dictionary key❌ dict key नहीं बन सकती✅ dict key बन सकता है
Use caseबदलने वाला data (cart items)Fixed data (coordinates, dates)

Memory proof (खुद run करके देखें)

import sys

l = [10, 20, 30, 40, 50]
t = (10, 20, 30, 40, 50)

print("List size :", sys.getsizeof(l), "bytes")
print("Tuple size:", sys.getsizeof(t), "bytes")
List size : 104 bytes Tuple size: 80 bytes

Same 5 items, tuple कम memory लेता है — क्योंकि list future growth के लिए extra space reserve करती है, tuple कभी grow नहीं होता.

Dictionary-key वाला अंतर (interview favourite)

locations = { (28.61, 77.20): "Delhi" }     # tuple key: OK
print(locations[(28.61, 77.20)])

wrong = { [28.61, 77.20]: "Delhi" }         # TypeError:
                                            # unhashable type: 'list'
Delhi

सिर्फ immutable objects dictionary keys बन सकते हैं. Tuple बदल नहीं सकता, इसलिए Python उसे hash कर सकता है; list बदल सकती है, इसलिए hash नहीं हो सकती.

कब कौन-सा use करें?

  • List use करें जब data बदलेगा: shopping cart, student attendance, todo items.
  • Tuple use करें जब data कभी नहीं बदलना चाहिए: (latitude, longitude), RGB colours, date of birth, function से multiple values return.
  • Interview line: "Tuple एक read-only list है — safer, faster और hashable."

Frequently Asked Questions

List और tuple में main अंतर क्या है?

List mutable है — बनने के बाद items add, remove या change हो सकते हैं — जबकि tuple immutable है और एक बार बनने के बाद modify नहीं हो सकता.

Tuple list से तेज़ क्यों है?

Tuple का size fixed होता है, इसलिए Python एक बार exact memory allocate करके internal optimizations लगाता है, जबकि list growth के लिए extra space और bookkeeping रखती है.

क्या tuple dictionary key बन सकता है?

हां, क्योंकि tuples immutable हैं इसलिए hashable हैं. Lists dictionary keys नहीं बन सकतीं क्योंकि वे बदल सकती हैं.