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
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}")
Comments
Leave a comment