In my code for a maths quiz when i type N when it comes up with play again it plays again when it shouldnt. Here is my code:
def play_again():
again= input("would you like to play again? y for yes and n for no")
while again not in ['Y','y','N','n']:
again = input("please enter 'Y' or 'N'")
if again== 'y' or 'Y':
do_the_quiz()
else:
print("cheers lad thanks for playing")
exit()
can you spot something wrong in it that makes N or n play again when it shouldnt.