-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path17.py
More file actions
32 lines (32 loc) · 686 Bytes
/
17.py
File metadata and controls
32 lines (32 loc) · 686 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
name=input('Eneter a name:')
marks=[]
for i in range(5):
m=int(input(f'Enter a marks for subeject : {i+1}'))
marks.append(m)
class Student:
def total_marks(self,marks):
total=sum(marks)
return total
def average_marks(self,total):
avg=total/5
return avg
def grade(self,avg):
if avg>=90:
return 'A'
elif avg>=75:
return 'B'
elif avg>=60:
return 'C'
elif avg>=50:
return 'D'
else:
return 'F'
s1=Student()
total=s1.total_marks(marks)
avg=s1.average_marks(total)
grade=s1.grade(avg)
print('-------Student Report-------')
print(f'Name : ',name)
print(f'Total marks',total)
print(f'Average marks',avg)
print(f'Grade',grade)