0

This is how my program look like.

m=(input("Did the patient suffer from pain shift ? type 'y' or 'n' \n")).casefold()
if m=="y":
  M=1
elif m=="n":
  M=0
else:
  print ("error entry start over ")

How to get the program not to ask the next question if user entered any thing other than y or n?

I am very very beginner I am just in my 3rd day learning so I don't have enough functions dictionary to use.

wwii
  • 23,232
  • 7
  • 37
  • 77

1 Answers1

0
  • If you want to terminate the program you can use the exit() function.
  • If you want to restart the questions from the beginning you have to use a while loop.

This might help you in the second case: https://bobbyhadz.com/blog/python-while-loop-user-input