Test Index

Python Revision Tour Get it on Google PlayDownload on the App Store CBSE Board Videos

© examsnet.com
Question : 66 of 102
Marks: +1, -0
State True or False :
“In Python, tuple is a mutable data type”.
[CBSE 2024 Compartment]
Solution:  
Concept:
A mutable object can be changed in place after it is created (list, dictionary). An immutable object cannot be changed (int, float, string, tuple).
Explanation:
A tuple cannot be changed once it is created:
>>> T = (10, 20, 30)
>>> T[0] = 5
TypeError: 'tuple' object does not support item assignment
So a tuple is an immutable data type and the statement is False.
Key point: List is the mutable sequence; tuple is its immutable counterpart.
Answer:
Option B (False)
© examsnet.com
Advertisements
Go to Question: