while
we’re at it, let’s use proper style. These are not functions, they are statements. They should have whitespace and shouldn’t have parentheses:
while pw == 1:
...
if a == "y" or pw < 2:
...
elif a == "n":
...
while
we’re at it, let’s use proper style. These are not functions, they are statements. They should have whitespace and shouldn’t have parentheses:
while pw == 1:
...
if a == "y" or pw < 2:
...
elif a == "n":
...
Here is alternate:
def main():
response = input('\nHello brave adventurer! \nAre you ready to start your quest? (y/n) ')
while response not in ('y', 'n'):
response = input("\nThat was an invalid input. \nEnter 'y' for yes, or 'n' for no: ")
if response == 'y':
print("\nGreat! Glad that you've decided to begin your adventure with us. \nBuckle up!")
else:
print("\nWell, that is unfortunate. Okay, bye!")
main()