I'm trying to create a loop in order to bring the user back to the beginning of the program. I can't get it to print "Welcome to the comparison function". The program will run, asking user for input 1 and 2 and then will print the answer of the comparison, but I can not figure out how to get it to start over.
def comparison():
loop = True
while (loop):
print(" Welcome to the comparison function")
a = int (input("Enter your first number for value a, then hit enter key:"))
b = int (input("Enter your second number for value b, then hit enter key:"))
def compare (a,b):
if a>b:
return 1
elif a==b:
return 0
else:
return -1
answer = compare(a,b)
print (answer)
while True:
response=input ("Would you like to perform another comparison? (yes/no)")
if response=="yes" or response =="YES" or response =="Yes":
print ("Thank you!")
break
elif response=="no" or response=="NO" or response =="No":
loop=False
print ("Thank you, have a great day!")
break
else:
continue