टुपल में किसी मान तक कैसे पहुँचें?
How to access a value in Tuple?
A
mytuple (1)
B
mytuple [1]
C
mytuple {1}
D
None of the above
Explanation
The correct way to access a value in a tuple is by using square brackets with the item's index.
Answer: b) mytuple[1]
Here's a breakdown of why this is the correct answer and the others are not:
- Correct:
mytuple[1]- Tuples are an indexed collection, with the first item being at index
0, the second at index1, and so on. - To access an item, you refer to its index number within square brackets after the tuple's name.
- Tuples are an indexed collection, with the first item being at index
Correct Answer: B) mytuple [1]