I am quite a beginner at using Python. I am trying to create a loop for a series of questions. What I want it to do is ask the user to input a number corresponding with an option provided, range being 1-4. If the user enters a number between them, it records it and carries onto next question. However, even if the user types anything else, it will display that it is incorrect (as I had used an else statement), but instead of re-asking the same question, it simply moves on. Could someone point me in the right direction please?
Here is a sample code.
print()
print("Please select the module ")
print("Press 1 for")
print("Press 2 for")
print("Press 3 for")
print("Press 4 for")
choice = input("> ")
if choice == '1':
buddy.module = ("JP")
elif choice == '2':
buddy.module = ("ID")
elif choice == '3':
buddy.module = ("MC")
elif choice == '4':
buddy.module = ("MC")
else:
print("Incorrect option")