Python_Institute
PCEP-30-02 · Question #364
Assuming that the tuple is a correctly created tuple, the fact that tuples are immutable means that the following instruction: my_tuple[1] = my_tuple[1] + my_tuple[0]
The correct answer is A. is illegal. See the full explanation below for the reasoning.
Question
Assuming that the tuple is a correctly created tuple, the fact that tuples are immutable means that the following instruction:
my_tuple[1] = my_tuple[1] + my_tuple[0]
Options
- Ais illegal
- Bmay be illegal if the tuple contains strings
- Ccan be executed if and only if the tuple contains at least two elements
- Dis fully correct
How the community answered
(42 responses)- A83% (35)
- B2% (1)
- C10% (4)
- D5% (2)
Community Discussion
No community discussion yet for this question.