It seems I can't get my nestled while loop to stop repeating the output print('Y/N only accepted answers.')
. The first while loop I have works as intended, whereas if I enter anything other than Y/y/N/n, it tells me once that Y/N are the only accepted answers, then repeats the question a single time.
def initalSequence():
print('*WELCOME*')
trueVar1 = True
while trueVar1:
response1 = input('Do you like pizza? Y/N: ')
if response1 == 'Y' or response1 == 'y' or response1 == 'N' or response1 == 'n':
response2 = input('Are you sure about that? (Y/N): ')
trueVar1 = False
trueVar2 = True
while trueVar2:
if response2 == 'Y' or response2 == 'y' or response2 == 'N' or response2 == 'n':
print(countDown())
trueVar2 = False
break
else:
print('Y/N only accepted answers.')
continue
else:
print('Y/N only accepted answers.')
continue
print(initalSequence())
I simply want the nestled while loop to do exactly what the initial while loop is doing. I could understand utilizing a try and except if I was asking for integers, but I don't know of how I could utilize that with a string.