Jun-29-2021, 03:09 PM
Hey up, pretty simple query. I just want to check the user has entered either y or n , its going straight to the else: regardless of the input
Thanks for anybody who has a moment to give feedback.
Thanks for anybody who has a moment to give feedback.
def ask():
while True:
try:
reply = str(input("Do you want another drink Y/N "))
except:
while reply.lower() not in ("y","n"):
print("you have incorrectly entered - pick Y/N")
continue
else:
print('you have correctly entered y or n')
break
ask()
