You are on page 1of 1

import math

# 1. Add
# 2. Subtract
# 3. Multiply
# 4. Divide

print("User Please Select An Option Below To Perform Calculation: (1-6)")


print("1. Add")
print("2. Subtract ")
print("3. Multiply")
print("4. Divide")
print("5. Square Root ")
print("6. Raise Power ")
operation = input()

if operation == "1" : # Perform Addition


first = input("first: ")
second = input("second: ")

sum = float(first) + float(second)


print(sum)

elif operation == "2" : # Perform Subtraction


first = input("first: ")
second = input("second: ")

sum = float(first) - float(second)


print(sum)
elif operation == "3" : # Perform Multiplication
first = input("first: ")
second = input("second: ")

sum = float(first) * float(second)


print(sum)
elif operation == "4" : # Perform Division
first = input("first: ")
second = input("second: ")

sum = float(first) / float(second)


print(sum)
elif operation == "5" : # Perform Square Root
first = float(input("Number : "))
print("The Square Root is %f" %(math.sqrt(first)))
elif operation == "6" : # Perform Raise To Power
first = int(input("Number : "))
print("The Square is %d" %(pow(first, 2)))
else :
print("Invalid Entry.")

You might also like