I'm trying to break out of the def Converter loop and then onto my next code. I have tried return but it doesn't work. Break gives me a syntax error. Please edit the code directly since i'm really bad at imputing foreign code. This is python 3. Many Thanks
from turtle import Screen, Turtle
print("Please select your conversion:")
invalid_input = True
def Converter() :
conversion = input ("metric to metric type mm, metric to imperial type mi, units of water type w, for physics equations type p, for math equations type m and for quick facts type q:")
print("Please select your conversion:")
if conversion == "mm":
#selection = "metric to metric conversions!"
invalid_input = False
elif conversion == "mi":
selection = "metric to imperial conversions!"
invalid_input = False
elif conversion == "w":
selection = "water conversions!"
invalid_input = False
elif conversion == "p":
selection = "physics equations!"
invalid_input = False
elif conversion == "m":
selection = "maths equations!"
invalid_input = False
print("You have selected", selection + "!")
elif conversion == "q":
selection = "quick facts!"
invalid_input = False
else:
print("\n")
print("Invalid! Please try again.\n \n \n")
while invalid_input :
Converter()
print("\n")
print("You have selected", selection + "!")
invalid_input = True
def start() :
decision = input ("Is this correct? If correct type y, if incorrect type n.")
if decision == "y":
#stuff
invalid_input = False
while invalid_input : True# this will loop until invalid_input is set to be True
start()