13
Question Question 13
What is the output of the following code ?
t = (10, 20, 30, 40, 50, 50, 70)
print(t[5:-1])- Blank output( )
- (50,70)
- (50,50,70)
- (50,)
(50,)
Reason — Length of tuple t is 7. t[5 : -1] represents tuple slice t[5 : (7-1)] = t[5 : 6] i.e., the element at index 5. So output is (50,).