We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42e74a3 commit 3376c7bCopy full SHA for 3376c7b
Inheritence.py
@@ -0,0 +1,18 @@
1
+class person:
2
+ def __init__(self,fname,lname):
3
+ self.Firstname=fname
4
+ self.Lastname=lname
5
+ def print(self):
6
+ print(self.Firstname)
7
+ print(self.Lastname)
8
+ print(self.contactNumber)
9
+ def personContact(self,contact):
10
+ self.contactNumber=contact
11
+class Student(person):
12
+ def __init(self,sname,slname):
13
+ self.studentFname=sname
14
+ self.studentLname=slname
15
+ super.__init__(self,sname,slname) #student class will run all the properties of parentclass
16
+Student1=Student("osama","Ayub")
17
+Student1.personContact(3314828005)
18
+Student1.print()
0 commit comments