Commit 1de11e8b by arjun.b

calculator

parent 0c82e15d
n1=int(input("enter the first number")) n1=int(input("enter the first number"))
n2=int(input("enter the second number")) n2=int(input("enter the second number"))
print("\n") print("\n")
def add(n1,n2): def add(n1,n2):
return n1+n2 return n1+n2
...@@ -8,6 +9,8 @@ def sub(n1,n2): ...@@ -8,6 +9,8 @@ def sub(n1,n2):
def mul(n1,n2): def mul(n1,n2):
return n1*n2 return n1*n2
def div(n1,n2): def div(n1,n2):
if n2==0:
print("not defined")
return n1/n2 return n1/n2
print("sum=",add(n1,n2)) print("sum=",add(n1,n2))
print("sub=",sub(n1,n2)) print("sub=",sub(n1,n2))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment