저는 문자 맞추기 게임을 파이썬으로 완성했습니다. 사용자가 선택할 수있는 문자는 "a, b, c 및 d"입니다. 나는 그들에게 5 번 시도하는 법을 알고 있지만 올바른 편지 중 하나를 추측 할 때, 나는 그 루프를 깨고 그 선수를 축하 할 수 없다.루프를 벗어나는 방법을 알아낼 수 없습니다.
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.')
들여 쓰기를 수정하십시오. – TerryA