Single Choice
Not Set
QWhat is the type of the following variable
aTuple = ("Orange")
print(type(aTuple))
ID: #3716
Python Tuple MCQ
351 views
Question Info
#3716Q ID
Not SetDifficulty
Python Tuple MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
To create a tuple with a single item, you need to add a comma after the item. Otherwise, Python will not recognize the variable as a tuple, and it will treat it as a string type.
For example:
aTuple = ("Orange")
print(type(aTuple))
bTuple = ("Orange",)
print(type(bTuple))
Output
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic