Programming Language Python Tuple MCQ Question #3722
Single Choice Not Set

QWhat is the output of the following tuple operation
aTuple = (100, 200, 300, 400, 500)
aTuple.pop(2)
print(aTuple)

ID: #3722 Python Tuple MCQ 272 views
Question Info
#3722Q ID
Not SetDifficulty
Python Tuple MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A (100, 200, 400, 500)
  • B (100, 300, 400, 500)
  • C AttributeError
Correct Answer

Explanation

A tuple is immutable. Once a tuple is created, you cannot remove its items, but you can delete the tuple completely. If you try to remove the item from the tuple, you will receive an AttributeError: 'tuple' object has no attribute 'pop'.

Share This Question

Challenge a friend or share with your study group.