my_tuple[1] = my_tuple[1] + my_tuple[0]
- can be executed if and only if the tuple contains at least two elements
- is fully correct
- may be illegal if the tuple contains strings
- is illegal
Explanation: The operation is illegal because the ‘tuple’ object does not support item assignment.
Tuples are immutable sequences, which means you cannot update them directly – adding, changing, or removing tuple items requires different types of operations to be performed, for example converting the tuple to a list, updating the list, and converting it back to a tuple.
More Questions: Python Essentials 1 – Module 4 Test
More Questions: Python Essentials 1 (PE1) Course Final Test
Please login or Register to submit your answer