Length of a List - len()

len()Β 
functionΒ 
determinesΒ 
theΒ 
numberΒ 
ofΒ 
elements
Β 
inΒ 
aΒ 
listΒ 
andΒ 
returnsΒ 
theΒ 
same.
len(list_name)
List = [1, 2, 3, 1, 2, 1, 2, 3, 2, 1] 
print(len(List))

Append to a List - append()

append()Β 
methodΒ 
addsΒ 
anΒ 
element
Β 
toΒ 
theΒ 
endΒ 
ofΒ 
theΒ 
list.
list.append (element)
List = ['Mathematics', 'chemistry', 1997, 2000] 
List.append(20544) 
print(List)

Insert into a List - insert()

insert()
Β 
methodΒ 
helpsΒ 
usΒ 
toΒ 
insertΒ 
anΒ 
elementΒ 
atΒ 
aΒ 
specificΒ 
indexΒ 
inΒ 
aΒ 
list.
list.insert(position_index, element)
List = ['Mathematics', 'chemistry', 1997, 2000] 
List.insert(2,10087)
print(List)

Remove from a List - remove()

TheΒ 
remove()Β 
methodΒ 
removesΒ 
theΒ 
specifiedΒ 
itemΒ 
fromΒ 
aΒ 
list.
list.remove(element)
List = [2.3, 4.445, 3, 5.33, 1.054, 2.5] 
List.remove(3) 
print(List)

Delete from a List - del

TheΒ 
delΒ 
keywordΒ 
removesΒ 
theΒ 
specifiedΒ 
indexΒ 
andΒ 
canΒ 
alsoΒ 
deleteΒ 
theΒ 
listΒ 
completely.
del list[index]
List = [2.3, 4.445, 3, 5.33, 1.054, 2.5] 
del List[0] 
print(List)

Minimum item of a List - min()

ListΒ 
methodΒ 
min()Β 
returnsΒ 
theΒ 
elementsΒ 
fromΒ 
theΒ 
listΒ 
withΒ 
minimumΒ 
value.
min(List)
List = [2.3, 4.445, 3, 5.33, 1.054, 2.5] 
print(min(List))

Maximum item of a List - max()

ListΒ 
methodΒ 
max()Β 
returnsΒ 
theΒ 
elementsΒ 
fromΒ 
theΒ 
listΒ 
withΒ 
maximumΒ 
value.
max(List)
List = [2.3, 4.445, 3, 5.33, 1.054, 2.5] 
print(max(List))

Sum of items in a List - sum()

TheΒ 
sum()Β 
functionΒ 
returnsΒ 
theΒ 
sumΒ 
ofΒ 
allΒ 
itemsΒ 
inΒ 
aΒ 
list.
sum(List)
List = [1, 2, 3, 4, 5] 
print(sum(List))