LIST and SLICING
:
Aim: Implement
a Program to implement list and slicing operations.
Algorithm:
1.Start
2.Define
a list
3.
Slice from third index to index one from last
4.stop
Program:
values = [100, 200, 300, 400, 500]
# Slice from third index to index one from last.
slice = values[2:-1]
print(slice)
Output:
[200, 300]
0 Comments:
Post a Comment