Skip to content

Commit 12e5ab9

Browse files
committed
slicing in list 1 and 2
1 parent 7e4d10e commit 12e5ab9

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Manipulating List/2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
N = [2, 6, 86, 25, 215, 36, 4, 9, 27, 39]
2+
Output = N[:5] # from the beginning (index 0) and upto index 5 but not including index 5
3+
print(Output)
4+

Manipulating List/Sliced List.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
N = [2, 6, 86, 25, 215, 36, 4, 9, 27, 39]
2+
Output = N[1:3] # from the index 1 and upto index 3 but not including index 3
3+
print(Output)
4+

0 commit comments

Comments
 (0)