-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGrade_calculate.py
37 lines (27 loc) · 953 Bytes
/
Grade_calculate.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
class CalculateGrade:
def homeWork (self):
print '=====Grade Calculation====='
print 'Enter the Marks as Obtained'
i = 1
self.homework = 0
while (i < 8):
self.homework1 = raw_input('Homework %s : '%(i,) )
self.homework = int(self.homework) + int(self.homework1)
i+=1
print self.homework
self.marks = (self.homework)/30)*100
print 'HW marks:', self.marks
self.Labs()
def Labs(self):
i = 1
self.Labs = 0
while (i < 10):
self.Lab1 = raw_input('Lab %s : '%(i,) )
self.Lab = int(self.Lab) + int(self.Lab1)
i+=1
print self.Lab
self.marks = (int(self.Lab)/30)*100
print 'Lab marks:', self.marks
if __name__== '__main__':
temp = CalculateGrade()
temp.homeWork()