############################################################ # # Ask the Question. # Get the answer. # Make response Upper Case # If Yes ..... rejoice and finish! # If No ..... weep and finish! # Otherwise ..... Error and TRY AGAIN!!!!!! # # Data Structures # =============== # # Many ways to say Yes ... Maybe a tuple of all? # To test response against # All elements Upper Case # Many ways to say No ... Maybe a tuple of all? # To test response against # All elements Upper Case ############################################################ Yes = ('Y', 'YES', 'OK') # All allowed Yes answers No = ('N', 'NO', 'NEVER' ) # All allowed No answers while True: Response = input("Do you understand Loops yet??? ").upper() if Response in Yes: print("Jolly Good!") break elif Response in No: print("Well, Try harder!") break else: print("Answer must be Yes or No!")