Answer to Question #257333 in Python for cho

Question #257333

Create a program that would accept two (2) user inputs and will be display the sum, difference, product, quotient, and, power of these user inputs. Refer to the following sample output of the program.


Sample Program Output


SIMPLE CALCULATOR

—————————————————

Enter 1st Number:

4.25

Enter 2nd Number:

2.5

—————————————————

Sum: 6.75

Difference: 1.75

Product: 10.625

Quotient: 1.7

Power: 37.2367976813595


1
Expert's answer
2021-10-27T03:49:16-0400
print("SIMPLE CALCULATOR")
print("—————————————————")
print("Enter 1st Number:")
number1=float(input())
print("Enter 2nd Number:")
number2=float(input())
print("—————————————————")
sumResult=number1+number2
differenceResult=number1-number2
productResult=number1*number2
quotientResult=number1/number2
powerResult=number1**number2
print(f"Sum: {sumResult}")
print(f"Difference: {differenceResult}")
print(f"Product: {productResult}")
print(f"Quotient: {quotientResult}")
print(f"Power: {powerResult}")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS