• 카테고리

    질문 & 답변
  • 세부 분야

    프로그래밍 언어

  • 해결 여부

    미해결

main()에서 계속 오답이라고 나옵니다.

18.05.04 08:00 작성 조회수 79

0

안녕하세요.

def main()에서 결과는 과제에서 요구하는대로 나오는데 계속 오답이라고 뜨네요.

이유가 무엇일까요…?? get_factorial_value와 is_positive_number는 정답이라고 나오기에 main()의 코드만 첨부합니다.

def main():

# ===Modify codes below=============

print ("Input a positive number : ")

user_input = 999

while user_input is not 0:

user_input = input()

if is_positive_number(user_input) is True:

result = get_factorial_value(int(user_input))

print(result)

return result

elif user_input is "0":

user_input = 0

else:

print("Input again, please")

print("Thank you for using this program")

# ==================================

답변 1

답변을 작성해보세요.

0

예제대로 다 실행을 해보셨나요? 중간 return 문이 의문스럽긴합니다.