-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4.py
51 lines (35 loc) · 1.05 KB
/
4.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
class Ouruniversity:
def __init__(self):
self.marks=-1
self.age=0
stud_id=""
def validate_marks(self):
if(self.marks>=0 and self.marks<=100):
return True
else:
return False
def validate_age(self):
if(self.age>=20):
return True
else:
return False
def check_qualification(self):
if(self.validate_marks() is True and self.validate_age() is True):
if(self.marks>=65):
return True
else:
return False
else:
return False
def setter(self,marks,age,stud_id):
self.marks=marks
self.age=age
self.stud_id=stud_id
def getter(self):
print("Student ID: ", self.stud_id)
print("Age: ",self.age)
print("Marks: ",self.marks)
stud1=Ouruniversity()
stud1.setter(90,24,"DIVS17")
stud1.getter()
print(stud1.check_qualification())