I have this function below, which I have done something wrong in somewhere.
valid = False
if product is not None:
quantity = input("Please enter the amount of this item you would like to purchase: ")
for i in quantity:
valid = True
print("We didn't recognise that number. Please try again.")
#If I get here, I want to loop back to the start of this function
quantity = quantityFunction(product)
the code should loop back to the start of the function if it hits the Value Error.
Then you should not use
return statements, otherwise the function will terminate, returning