-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassignment1.py
66 lines (52 loc) · 1.88 KB
/
assignment1.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#function to calculate average.
def average(m):
sum=0
absent=0
for(int i in range(0,len(m))):
absent=absent+1
else:
sum=sum+m[1]
avg=sum/(len(m)-absent)
print("average marks are" avg )
#Function to calculate highest and lowest marks in the class
def highestandlowest(m):
high=0
low=100
for i in range (0,len(m)):
if(type(m[i]!=type("")):
if(m[i]>high):
high=m[i]
if((m[i]<low)and type (m[i])!=type("")):
low=m[i]
print("/n highest score is:",high)
print("/n lowest score is:";low)
#function to calculate absent students
def absents(m):
count=0
for i in m:
if type(i)==type(""):
count+=1
print("/n No of absent student:"count)
#function to calculate frequency
def Frequencya(m):
f[0]
for j in range(1,100):
if(type(m[i]!=type(""));
if(m[i]==j):
count=count+1
f.append(count)
print("/n The marks in the subject FDS are....")
print(m)
#obtaining marks of highest frequency
for k in range(l,len(f)):
if(f[k]==high):
highest=k
print("/highest frequency marks are",highest)
#code
marks=["NA",49,42,38,42,43,"AB",48,50,"AB",34]
print("the marks in the subject'FDS'are")
print(marks)
average(marks)
highestandlowestscore(marks)
absent(marks)
frequency(marks)