Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

def add(a,b):

answer=a+b

print(str(a)+"+"+str(b)+"="+str(answer))

def sub(a,b):

answer=a-b

print(str(a)+"-"+str(b)+"="+str(answer))

def mul(a,b):

answer=a*b

print(str(a)+"*"+str(b)+"="+str(answer))

def div(a,b):

answer=a/b

print(str(a)+"/"+str(b)+"="+str(answer))

print("A: addition" )

print("B: subtraction")

print("C: multiplication")

print("D: division")

print("E: exit")

choice=input("ENTER YOUR CHOICE:")

if choice=="A" or "a":

print("addition")

a=int(input("enter your first number:"))

b=int(input("enter your second number:"))

add(a,b)

elif choice=="b" or "B":


print("substraction")

a=int(input("enter your first number:"))

b=int(input("enter your second number:"))

sub(a,b)

elif choice=="C" or "c":

print("multiplication")

a=int(input("enter your first number:"))

b=int(input("enter your second number:"))

mul(a,b)

elif choice=="D" or "d":

print("division")

a=int(input("enter your first number:"))

b=int(input("enter your second number:"))

div(a,b)

elif choice=="E" or "e":

print("exit")

quit()

You might also like