-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappend.py
More file actions
37 lines (37 loc) · 1.24 KB
/
append.py
File metadata and controls
37 lines (37 loc) · 1.24 KB
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
#declare variable
stu = ['arun','akash','babu','chandra','ciran','delhi','dedhu','eshwar','farahna','hana','babu','yogi','varun','ilaya','akila']
marks= [45,56,34,65,89,32,78,45,79,80,33,67,90,65,70]
roll= [1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015]
m = marks.index(min(marks))
x = marks.index(max(marks))
f = marks.count(max(marks))
print('Top scorer in class',stu[x],marks[x],roll[x])
print('Least scorer in class',stu[m],marks[m])
print('frequency of max marks',f)
roll.append(1016)
marks.append(90)
stu.append('sathish')
print('print appended roll no#',roll)
print('print appended marks no#',marks)
print('print appended student name#',stu)
roll.insert(1,10009)
marks.insert(1,30)
stu.insert(1,'tharun')
print('print inserted roll no#',roll)
print('print inserted marks no#',marks)
print('print inserted student name#',stu)
ads = [1017,1018,1019]
roll.extend(ads)
print('print extended roll no#',roll)
roll.remove(1018)
print('print removed roll no#',roll)
roll.pop(2)
print('print pop value in roll no#',roll)
roll.reverse()
print('print reverse no#',roll)
roll.sort()
print('print sort no#',roll)
c = roll.copy()
print('print copy no#',c)
cl = roll.clear()
print('cleared the existing copies',cl)