n1 = int(input("What is your first number?"))
n2 = int(input("What is your second number?"))
func = input("What is the function you want to carry out?")
def add(n1, n2):
""" adds up numbers"""
return n1 + n2
def subtract(n1, n2):
return n1 - n2
def multiply(n1, n2):
return n1 * n2
def division(n1, n2):
return n1/n2
replay = True
while replay:
if func == "add":
print (add(n1, n2))
elif func == "subtract":
print(subtract(n1, n2))
elif func == "multiply":
print(multiply(n1,n2))
elif func == "divide":
print(division (n1,n2))
else:
print("Function not known")
retry = input("Do you want to carry out another function?Y or N")
if retry =="Y" or "y":
replay = True
elif retry == "N" or "n":
replay = False
my question here is in the above code if i indent the last five lines once that is
retry = input("Do you want to carry out another function?Y or N")
if retry =="Y" or "y":
replay = True
elif retry == "N" or "n":
replay = False
then it is returning the answer from the first time i ran the code
why?