If a=(1,2,3,4), a[1:-1] is then
Answers
Answered by
1
Answer:
your question might be wrong check it again
Answered by
0
Concept:
In the same manner that we use slicing in strings and lists, we can do it in tuples. Tuple slicing is a technique for obtaining a range of items.
Given:
a=(1,2,3,4)
Find:
Find .
Solution:
The slicing operator is used to achieve tuple slicing.
Syntax: tuple_name[start:stop:step]
Furthermore, the 'step' portion is not necessary to be mentioned. If we don't mention the step part, the compiler assumes it's 1.
The 'stop' parameter tells where to stop excluding the index given.
Negative indexes are used to print the elements from the end.
will print from index 1 to last first.
∴
Similar questions