"""
Program Name: Simple calculation
Description: Simple calculation among two input numbers
"""
valid = False
while valid == False :
operation = input("Operations : \n1. Addition \n2. Substraction \n3. Multiplication \n4. Division \nTo operate : ")
if not operation.isdigit() or int(operation) < 1 or int(operation) > 4 :
print("Enter a valid option.")
else :
valid = True
valid = False
while valid == False :
num1 = input("Enter first number : ")
if not num1.replace("-", "").isdigit() :
print("Enter a valid number.")
else :
valid = True
num1 = int(num1)
valid = False
while valid == False :
num2 = input("Enter second number : ")
if not num2.replace("-", "").isdigit() :
print("Enter a valid number.")
else :
valid = True
num2 = int(num2)
if operation == "1" :
print(f"Sum = {num1 + num2}")
elif operation == "2" :
print(f"Difference = {num1 - num2}")
elif operation == "3" :
print(f"Product = {num1 * num2}")
else :
if num2 == 0 :
print(f"Quotient = Indefinite")
else :
print(f"Quotient = {num1 / num2}")