I have a letter guessing game to complete in Python. The letters the user can pick are "a,b,c, and d." I know how to give them five tries, but when I guess one of the correct letters, I can't break out the loop and congratulate the player.
g = 0
n = ("a", "b", "c", "d")
print("Welcome to the letter game.\nIn order to win you must guess one of the\ncorrect numbers.")
l=input('Take a guess: ');
for g in range(4):
if l == n:
break
else:
l=input("Wrong. Try again: ")
if l == n:
print('Good job, You guessed one of the acceptable letters.')
if l != n:
print('Sorry. You could have chosen a, b, c, or d.')