Computer Science, asked by livieliveliv, 5 months ago

Create a program that will successfully take in two mixed numbers and add, subtract, divide, and multiply them.
In Python!

Answers

Answered by Anonymous
2

Answer:

hello,

Explanation:

#PROGRAM TO FIND THE SUM ,DIFFERENCE,PRODUCT,QUOTIENT

a=eval(input("enter the first number"))

b=eval(input("enter the second number number"))

s=a+b

p=a*b

if a>b:

   d=a-b

   q=a/b

else:

   d=b-a

   q=b/a

print(s,"=sum",",",d,"=difference",",",p,"=product","and",q,"=quotient")  

hope it helps you

please mark brainliest

@ItzSnowySecret07

Answered by atrs7391
2

def summ():

   a = n1+n2

   print("The result: ", a)

def sub():

   s = n1-n2

   print("The result: ", s)

def mul():

   m = n1*n2

   print("The result: ", m)

def div():

   d = n1/n2

   print("The result: ", d)

n1 = int(input("Enter 1st number: "))

op = int(input("1 for addition, 2 for subtraction, 3 for multiplication, 4 for division: "))

n2 = int(input("Enter 2nd number: "))

if op == 1:

   summ()

elif op == 2:

   sub()

elif op == 3:

   mul()

elif op == 4:

   div()

else:

   print("Cannot solve, wrong operator!")

Similar questions