day 7-3 hangman
2023. 3. 10. 08:47ㆍ개인적인 공부/Python
##-- 끝날때 까지 반복하기
end_of_game = False
while not end_of_game:
guess = input("Enter your guess: ").lower()
for position in range(word_length):
letter = chosen_word[position]
if letter == guess:
display[position] = letter
print(display)
if "_" not in display:
end_of_game = True
print("You win!")
'개인적인 공부 > Python' 카테고리의 다른 글
day 8-2 python (위치와 키워드) (0) | 2023.03.10 |
---|---|
day 8-1 python (입력 값이 있는 함수) (0) | 2023.03.10 |
day 7-2 hangman (1) | 2023.03.10 |
day 7-1 hangman (0) | 2023.03.10 |
day 6-5 python (무작위 장애물) (0) | 2023.03.02 |