In this piece of code I am looking for a input:
mode = input("Generate S1(0) or S2(1)?\n")
if mode == "0":
mode = "S1"
elif mode == "1":
mode = "S2"
else:
print("Mode not recogised!")
for being able to handle error better (mode>1), i.e. when if hit the else condition, I want the code to ask the input again.
Any idea how i can do that or which function I am looking for?