Python Programming - Data Types - Discussion

Discussion Forum : Data Types - General Questions (Q.No. 50)
50.
What will be the result of the following code snippet?
my_tuple = (1, 2, 3, 4, 5)
result = my_tuple[2:]
print(result)
(3, 4, 5)
(1, 2, 3)
(1, 2)
(2, 3, 4, 5)
Answer: Option
Explanation:
Slicing from index 2 to the end includes elements at indices 2, 3, and 4.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.