#python #anaconda #jupyter-notebook #visual-code #html #css #javascript #http 제목중간참조 4 질문2021-04-18 15:30작성자수강생def getResult(status): if '_' in status: a= "You lose" return a else: a= "You win" return adef updateStatus(word, x, status): if status == word: getResult(status) else: if word.count(x) > 0 : if word.count(x) == 1: status = status[:word.find(x)] + x + status[word.find(x)+1:] new_status = status return new_status elif word.count(x) > 1: for i in range(0,word.rfind(x)+1): if word[i] == x: status = status[:i] + x + status[i+1:] else: continue new_status = status return new_status else: new_status = status return new_status def startGame(word): status = "_" * (len(word)) print(status) for i in range(len(word),0,-1): print(i, "chances.", end=' ') a= input("Enter a letter: ") updateStatus(word, a, status) return getResult(status)word = 'HIPPOPOTAMUS' result = startGame(word) print(result) 를 실행하면 ____________ 12 chances. Enter a letter: H 11 chances. Enter a letter: P이런 식으로 쭉 나오다가 모든 글자를 입력해도 결국 you loose가 나옵니다.. 그리고 updatestatus에서 new_status를 반환하라고 해놨는데도 반환값도 나오지 않구요 ㅠㅠㅠ무엇이 원인인지 아무리 고민해도 모르겠습니다 ㅠ 목록수정삭제답변글쓰기 댓글 [1] 댓글작성자(*)비밀번호(*)내용(*) 댓글 등록 더보기이전module 질문 있습니다감사합니다2021-04-18다음 step 12 마지막 질문 있습니다질문있습니다2021-04-18 Powered by MangBoard | 워드프레스 쇼핑몰 망보드