From bd1d6cc75a97b0459c67c89e4f0cebc0ad97b6e4 Mon Sep 17 00:00:00 2001 From: prithiv718 Date: Fri, 28 Nov 2025 08:59:13 +0530 Subject: [PATCH 1/5] Update Constructors : Welcome Message with Student Name.md --- Constructors : Welcome Message with Student Name.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Constructors : Welcome Message with Student Name.md b/Constructors : Welcome Message with Student Name.md index 9c047787..fbf4e011 100644 --- a/Constructors : Welcome Message with Student Name.md +++ b/Constructors : Welcome Message with Student Name.md @@ -11,9 +11,16 @@ To write a Python program that creates a **Student** class with a **default cons 5. **Execute the Program**: Instantiate the `Student` class and call the `show` method. ## 🧾 Program +``` +class Student: def init(self,name,userid): self.name=name self.userid=userid self.display() +def display(self): print(self.userid) name=input() userid=input() obj = +Student(name,userid) obj.display() +``` -Add code here ## Output +image ## Result +The Python program that creates a Student class with a default constructor,which will +take the name and userid of the person as parameters print the userid of the person. From 7dcd6f5553b4f75f766813cd4671ff0bdc52909a Mon Sep 17 00:00:00 2001 From: prithiv718 Date: Fri, 28 Nov 2025 09:01:25 +0530 Subject: [PATCH 2/5] Update Destructor.md --- Destructor.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Destructor.md b/Destructor.md index dc5537f6..d1fdcce2 100644 --- a/Destructor.md +++ b/Destructor.md @@ -21,9 +21,20 @@ The program defines a class `Demo` with: - Create an instance of the `Demo` class. - Delete the object using the `del` keyword. ## Program -Add code Here +``` +class Demo: +def __init__(self): +print("Alive") +def __del__(self): +print("The object no longer exists") +obj=Demo() +del obj +``` ## 🧪 Output +image ## Result +This project demonstrates how to implement a destructor in Python using a simple class +is executed sucessfully. From 17c1b76be49af040a577453e7a4a8147f8b70f79 Mon Sep 17 00:00:00 2001 From: prithiv718 Date: Fri, 28 Nov 2025 09:03:53 +0530 Subject: [PATCH 3/5] Update Heirarchical_Inheritence.md --- Heirarchical_Inheritence.md | 49 ++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/Heirarchical_Inheritence.md b/Heirarchical_Inheritence.md index ebd02d90..660fc235 100644 --- a/Heirarchical_Inheritence.md +++ b/Heirarchical_Inheritence.md @@ -31,6 +31,53 @@ To write a Python program that uses **Hierarchical Inheritance** to input and di 5. Display collected information using class methods. ## Program -Add code here +``` +class Details: +def __init__(self, name, age): +self.name = name +self.age = age +def getName(self): +return self.name +def getAge(self): +return self.age +class Employee(Details): +def __init__(self, name, age, employee_id, department): +super().__init__(name, age) +self.employee_id = employee_id +self.department = department +def getEmployeeDetails(self): +print("Employee Information:") +print("Name:", self.getName()) +print("Age:", self.getAge()) +print("Employee ID:", self.employee_id) +print("Department:", self.department) +class Patient(Details): +def __init__(self, name, age, patient_id, disease): +super().__init__(name, age) +self.patient_id = patient_id +self.disease = disease +def getPatientDetails(self): +print("Patient Information:") +print("Name:", self.getName()) +print("Age:", self.getAge()) +print("Patient ID:", self.patient_id) +print("Disease:", self.disease) +emp_name = input() +emp_age = int(input()) +emp_id = input() +emp_dept = input() +employee = Employee(emp_name, emp_age, emp_id, emp_dept) +11/20/25, 6:12 PM Module-5/Heirarchical_Inheritence.md at main · kirupa169/Module-5 +https://github.com/kirupa169/Module-5/blob/main/Heirarchical_Inheritence.md 2/3 +The program is successfully excexuted +pat_name = input() +pat_age = int(input()) +pat_id = input() +pat_disease = input() +patient = Patient(pat_name, pat_age, pat_id, pat_disease) +employee.getEmployeeDetails() +patient.getPatientDetails() +``` ## Sample Output +image From 961814cc02df792ff1384b1d6723f6a380a63100 Mon Sep 17 00:00:00 2001 From: prithiv718 Date: Fri, 28 Nov 2025 09:04:44 +0530 Subject: [PATCH 4/5] Update Multilevel_Inheritence.md --- Multilevel_Inheritence.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Multilevel_Inheritence.md b/Multilevel_Inheritence.md index 70d92b10..437f69e6 100644 --- a/Multilevel_Inheritence.md +++ b/Multilevel_Inheritence.md @@ -26,7 +26,22 @@ To write a Python program that uses multilevel inheritance to get and display a - Print all details using class methods. ## Program -Add code here +``` +class student: +def __init__(self,x,y,z): +self.x=x +self.y=y +self.z=z +class s(student): +def show(self): +print(f"{self.x} {self.y} {self.z}") +x=input() +y=int(input()) +z=int(input()) +obj=s(x,y,z) +obj.show() +``` ## Sample Output +image From 8bacc05a1549bc6d86d0882b58189a4dd888e65d Mon Sep 17 00:00:00 2001 From: prithiv718 Date: Fri, 28 Nov 2025 09:05:34 +0530 Subject: [PATCH 5/5] Update Multiple Inheritence.md --- Multiple Inheritence.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Multiple Inheritence.md b/Multiple Inheritence.md index 9f6f0020..50643bb7 100644 --- a/Multiple Inheritence.md +++ b/Multiple Inheritence.md @@ -24,6 +24,29 @@ To write a Python program to calculate **Add, Sub & Division** using **Multiple - Display the results of the three operations. ## 💻 Program -Add code here +``` +class Calculation1: +def Summation(self, a, b): +return a + b +class Calculation2: +def multi(self, a, b): +return a * b +class Derived(Calculation1, Calculation2): +def Division(self, a, b): +if b != 0: +return a / b +else: +return "Division by zero is not allowed" +num1 = float(input()) +num2 = float(input()) +obj = Derived() +sum_result = obj.Summation(num1, num2) +mul_result = obj.multi(num1, num2) +div_result = obj.Division(num1, num2) +print(sum_result) +print(mul_result) +print(div_result) +``` ## Output Example +image