Python Programming - Tuples
Exercise : Tuples - General Questions
- Tuples - General Questions
41.
How can you delete an entire tuple?
Answer: Option
Explanation:
The
del
keyword is used to delete a tuple.
42.
What is the purpose of the
tuple.extend()
method?
Answer: Option
Explanation:
The
tuple
type in Python does not have an extend()
method.
43.
Which of the following statements about tuples in Python is correct?
Answer: Option
Explanation:
Tuples can contain duplicate elements as they are ordered and allow repetition.
44.
What is the output of the expression
tuple('python')[::-1]
?
Answer: Option
Explanation:
The
[::-1]
slice reverses the order of elements in the tuple.
45.
What is the purpose of the
tuple.__contains__(element)
method?
Answer: Option
Explanation:
The
__contains__
method is used to check if the tuple contains a specified element.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers