-
카테고리
-
세부 분야
프로그래밍 언어
-
해결 여부
미해결
과제 질문
19.03.14 17:56 작성 조회수 120
0
'''# -- coding: utf-8 --
def main():
print("본 프로그램은 섭씨를 화씨로로 변환해주는 프로그램입니다")
print("============================")
===Modify codes below=================
def input_celsius_value():
print("변환하고 싶은 섭씨 온도를 입력해 주세요: ")
celsius_value=float(input(("변환하고 싶은 섭씨 온도를 입력해 주세요: ")))return celsius_value
def convert_celcius_fahrenheit(celsius_value):
fahrenheit_value=((9/5)*celsius_value)+32
return fahrenheit_value
def print_fahrenheit_value(celsius_value,fahrenheit_value):
print("섭씨온도:", celsius_value)
print("화씨온도", fahrenheit_value)
======================================
print("===========================")print("프로그램이 종료 되었습니다.")
if name == 'main':
main()
celsius_value=input_celsius_value()
fahrenheit_value=convert_celcius_fahrenheit(celsius_value)
print_fahrenheit_value(celsius_value, fahrenheit_value)
이렇게 해서 똑같은 결과를 얻었는데, 과제를 제출하면 2개 실패로 나와요.아무리 봐도 문제를 못 찾겠어요.
'''
C:\Users\Sue\workspace\python_mooc\lab_4>python fahrenheit_converter.py
본 프로그램은 섭씨를 화씨로로 변환해주는 프로그램입니다
변환하고 싶은 섭씨 온도를 입력해 주세요: 32.2
섭씨온도: 32.2
화씨온도 89.96000000000001
프로그램이 종료 되었습니다.
C:UsersSueworkspacepython_mooclab_4>submit.bat adpl136472
∙ Session token prefix: fbb58830aa
∙ In the legacy mode, all cases will run serially!
✔ [0] Session 0 is ready.
Uploading files: 100%|████████████████| 6.90k/6.90k [00:00<00:00, 33.2kbytes/s, file=unit_test_fahrenheit_converter.py]
✔ [0] Uploading done.
python-kernel: skipping build phase due to missing "setup.py" file
✔ Build finished. (exit code = 0)
Generating result sheet...
Test Case | Passed? | Feedback
test_convert_celsius_fahrenheit | FAILED | Failed
test_input_celsius_value | PASSED | Good Job
test_main | FAILED | Failed
test_print_fahrenheit_value | PASSED | Good Job
Reading source file...
Transferring results to server...
Transfer completed.
✔ Execution finished. (exit code = 0)
✔ [0] Execution finished.
답변을 작성해보세요.
답변 0