-
Notifications
You must be signed in to change notification settings - Fork 0
/
list_assignment1_day2_letsupgrade.py
38 lines (38 loc) · 1.31 KB
/
list_assignment1_day2_letsupgrade.py
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
>>> family=['Father','Mother','son',"there ages :",50,45,10,'percentage of son:',98.89]
>>> family
['Father', 'Mother', 'son', 'there ages :', 50, 45, 10, 'percentage of son:', 98.89]
>>> family.reverse()
>>> family
[98.89, 'percentage of son:', 10, 45, 50, 'there ages :', 'son', 'Mother', 'Father']
>>> family.reverse()
>>> family
['Father', 'Mother', 'son', 'there ages :', 50, 45, 10, 'percentage of son:', 98.89]
>>> print('there are '+family[0]+family[1]+family[2]+' in the family')
there are FatherMotherson in the family
>>> family.pop()
98.89
>>> family
['Father', 'Mother', 'son', 'there ages :', 50, 45, 10, 'percentage of son:']
>>> family.append(99.8)
>>> print('family after editing marks of the son ')
family after editing marks of the son
>>> family
['Father', 'Mother', 'son', 'there ages :', 50, 45, 10, 'percentage of son:', 99.8]
>>> family.count("son")
1
>>> family.index(45)
5
>>> family.copy()
['Father', 'Mother', 'son', 'there ages :', 50, 45, 10, 'percentage of son:', 99.8]
>>> fam=family.copy()
>>> fam
['Father', 'Mother', 'son', 'there ages :', 50, 45, 10, 'percentage of son:', 99.8]
>>> family.remove(10)
>>> family
['Father', 'Mother', 'son', 'there ages :', 50, 45, 'percentage of son:', 99.8]
>>> family.clear()
>>> family
[]
>>> type(family)
<class 'list'>
>>>