-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path044_Program_List In Python-2.py
More file actions
43 lines (41 loc) · 1018 Bytes
/
044_Program_List In Python-2.py
File metadata and controls
43 lines (41 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Use of some important 'functions' of list
list1 = ['ADIL','RABBI',300,'RAIYAZ',500,'NOYON','SAKA']
'''
print(len(list1)) # length (number of items) of the list
'''
'''
list1.append("ABU") # add new item into the 'last position' of the list
print(list1)
'''
'''
list1 = list1 + ["ABU", "SHUVO"]
print(list1)
'''
'''
list1.insert(2,"ABU") # add new item into a very specific position of the list
print(list1)
'''
'''
list1.remove(500) # remove a definite item from the list
print(list1)
'''
'''
list1.pop() # pop will remove the very last item of the list
print(list1)
'''
'''
list1.pop(3) # pop will remove the 'index value' assigned item from the list
print(list1)
'''
'''
del list1[2] # to delete the item indexed at '2'
print(list1)
'''
'''
list1.clear() # to clear all the items of the list
print(list1)
'''
'''
x = list1.index('RABBI') # to get the 'list index' number of an item
print(x) # x is nothing but a variable here
'''