Which of the following statements about tuples in Python is true?
-
A
Tuples can be modified after creation.
-
B
Tuples use square brackets [ ] for declaration.
-
C
Tuples can only contain immutable elements.
Correct answer
-
D
Tuples can only contain integers.
Correct answer
C. Tuples can only contain immutable elements.
16 views
Explanation
Tuples can contain any immutable data type, including integers, strings, and other tuples.
Doubts & discussion
Not sure why the answer is C? Ask here and get an explanation.
Ask a doubt about this MCQ