Post

Answer: D. Error 🚫 (Specifically, an AttributeError)
Why? In Python, tuples are immutable. This means their contents cannot be changed after creation.
The insert() method is used to add an element to a list, which is a mutable sequence. Since Tuple is a tuple (not a list), it does not have an insert() method. Attempting to call Tuple.insert(2, 15) will raise an AttributeError because the insert attribute (method) does not exist for tuple objects.
English

@PythonPr The correct answer is D. Error.
why the code fails:
The Problem: Immutability
In Python, tuples are immutable, meaning once they are created, they cannot be changed, added to, or modified. Because of this:
Tuples do not have an .insert() method.
The .insert() method belongs to
English

@PythonPr Output: D) Error
Explanation:
Tuples are immutable in Python.
They don’t support insert() (that method exists only for lists).
Tuple = (5, 10, 20)
Tuple.insert(2, 15) # ❌ AttributeError
English

@PythonPr tuple is immutable so no changes allowed it will through error
option D is correct
English

@PythonPr Tuple is unchangeable we can't add and modify the tuple soooo answers is error
English

@PythonPr D) Error
Tuple is immutable so answer is Error.
If the data type list then insert is possible.
English

@PythonPr D. Tuples are immutable and don't have methods like insert.
English
















