0
Given a Tuple tup1= (10, 20, 30, 40, 50, 60, 70, 80, 90). What will be the output of print (tup1 [3:7:2])?
2 Antworten
+ 3
Abhinandh A
[3:7:2] means [start_index : end_index : step] and index start from 0 so at 3rd place value is 40 and step is 2 so next value will be 60. Since end_index is 7 but after 60 to 80 step is 2 but 80 will not be include in result because it's a end_index.
So output is (40, 60)
+ 2
Try it out in the playground and see for yourself