Skip to content

Commit d152229

Browse files
Merge pull request #478 from varunsingh005/master
solved issue #278
2 parents d9b54d9 + 03e8888 commit d152229

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

insert.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
list1 = [ 9, 2, 8, 4, 0, 1, 34 ]
2+
3+
# insert 45 at 5th index
4+
list1.insert(4, 45)
5+
print(list1)
6+
7+
list2 = ['q', 'b', 'u', 'h', 'p']
8+
9+
# insert z at the front of the list
10+
list2.insert(0, 'z')
11+
print(list2)

0 commit comments

Comments
 (0)