Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # inheritence
- # -----------
- class Student():
- def information(self, institution,result):
- self.institution = institution
- self.result = result
- return ('university: {} and cgpa: {} '.format(self.institution, self.result))
- class Access(Student):
- def additionalInfo(self, mail):
- self.email = mail
- return ('email: {} '.format(self.email))
- def combine(self, gpa, cgpa):
- self.termGpa = gpa
- self.cgpa = cgpa
- self.together = ('term gpa: {} , cgpa: {} '.format(self.termGpa, self.cgpa))
- return ('result: {} '.format(self.together))
- # obj
- std_1 = Access()
- info = 'east west university-3.00'
- varsity, result = info.split('-')
- print(std_1.information(varsity, result))
- print(std_1.combine(3.42, 2.84))
Advertisement
Add Comment
Please, Sign In to add comment