choice = raw_input(‘Enjoying the course? (y/n)’)
while choice != ‘y’ and choice != ‘n’:
choice = raw_input("Sorry, I didn’t catch that. Enter again: ")
In this code, I wish that if the user has entered anything except ‘y’ or ‘n’ a re-prompt appears. But I am not able to comprehend: why we need to used ‘and’ and not ‘or’. For, the entered input can be either ‘y’ or ‘n’. So any one of the condition must be satisfied but ans requires both are to be satisfied. Please help!