Single Choice
Not Set
QWhat is the output of the following
aTuple = (10, 20, 30, 40, 50, 60, 70, 80)
print(aTuple[2:5], aTuple[:4], aTuple[3:])
ID: #3712
Python Tuple MCQ
212 views
Question Info
#3712Q 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
(30, 40, 50) (10, 20, 30, 40) (40, 50, 60, 70, 80)
To get a sub tuple out of the tuple, we need to specify the range of indexes. We need to specify where to start and where to end the range.
Syntax: tuple[start:end] If the start is missing it takes 0 as the starting index.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic