Which of the following is a python tuple?
A) [1, 2, 3]
B) (1, 2, 3)
C) {1, 2, 3}
D) “1, 2, 3”
Answer:
B) (1, 2, 3)
Explanation:
In Python, tuples are represented using parentheses ( )
, and they are ordered and immutable sequences of elements. Option B (1, 2, 3)
is a valid Python tuple. Option A [1, 2, 3]
represents a list, option C {1, 2, 3}
represents a set, and option D "1, 2, 3"
is a string.