class calculator():
def __init__(self,a,b):
self.a=a
self.b=b
def addittion(self):
c=self.a+self.b
print(c)
def subtraction(self):
c=self.a-self.b
print(c)
def divison(self):
c=self.a/self.b
print(c)
def multiplication(self):
c=print(self.a*self.b)
print(c)
x=int(input("enter the number"))
y=int(input("enter the second number"))
a=calculator(x,y)
input=input("enter the process\n")
if(input=="add"):
a.addittion()
elif(input=="sub"):
a.subtraction()
elif(input=="mul"):
a.multiplication()
else:
a.divison()
Subscribe to:
Post Comments (Atom)
-
#these program uses -stream_loop option import os #loop four times os.system("ffmpeg -stream_loop 4 -i output.avi -c copy outputqsa....
-
DATASCIENCE pip install -U pip pip install nmap pip install matplotlib pip install scipy pip install scikit-learn pip install pandas ...
-
import random def add(list1): c=0 for x in list1: c+=x return c def mean(c): result=c/9 return result def median(list1,n)...
No comments:
Post a Comment