5 _ 6module
5 _ 6module
Batch: A1
Roll No: 03
Assignment No:- 05
Program:
def add (a,b):
return a+b
def subtract(a,b):
return a-b
return a*b
if b==0:
return a/b
Program:
import math_operations as mo
sum_result=mo.add(10,5)
difference=mo.subtract(10,5)
product=mo.multiply(10,5)
quotient=mo.divide(10,5)
print("sum",sum_result)
print("difference",difference)
print("product",product)
print("quotient",quotient)
print("divided by zero",mo.divide(10,0))
Output:-
Name: Akanksha Ashok Kagwade
Batch: A1
Roll No: 03
Assignment No:- 05
Program:
class Person:
self.name = name
self.age = age
def introduce(self):
class Student(Person):
super().__init__(name, age)
self.student_id = student_id
def introduce(self):
super().introduce()
student1.introduce()
Output:-