I'm new to Python and Stack Overflow so please bear with me. I'm creating a 'guess the number' game. When the program offers the user a hint the user should either enter 'y' or 'n' as indicated:
hint_option = str(input('Incorrect! Do you want a hint? (Y/N): ')).lower()
otherwise, if another letter (e.g.) is entered I want the program to print Invalid input! Please try again
hint_loop = False
while hint_loop != True:
if hint_option == 'y':
if user_guess > random_num:
hint = 'too high'
else:
hint = 'too low'
print(f'''Hint: Your guess was {hint}
''')
total_hints += 1
break
elif hint_option == 'n':
break
else:
print('Invalid input! Please try again')
I don't know what to do, could someone please help me?