Hi... just went through your question. The code written below will solve your issue:-
def ask_operation():
option = input('''
Enter the Serial Number of the
operation you want to perform''')
if option == "1":
addition()
elif option == "2":
subtraction()
elif option == "3":
multiplication()
elif option == "4":
division()
elif option == "5":
square()
else:
print("The operation you entered is not listed above")
ask_operation()
def addition():
num1 = int(input("Enter 1st number: "))
num2 = int(input("Enter 2nd number: "))
ans = num1 + num2
print("{} is the sum".format(ans))
def subtraction():
num1 = int(input("Enter 1st number: "))
num2 = int(input("Enter 2nd number: "))
ans = num1 - num2
print("{} is the diffrence".format(ans))
def multiplication():
num1 = int(input("Enter 1st number: "))
num2 = int(input("Enter 2nd number: "))
ans = num1 * num2
print("{} is the product".format(ans))
def division():
num1 = int(input("Enter 1st number: "))
num2 = int(input("Enter 2nd number: "))
ans = num1 / num2
print("{} is the quotient".format(ans))
def square():
num = int(input("Enter the number you want to sqaure: "))
ans = num ** 2
print("{} is the square of {}".format(ans, num))
print('''
1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Square
''')
ask_operation()
I hope you will be satisfied