시작하기무료로 시작하기

Pylint

동료가 다음 코드를 검토해 달라고 부탁했어요.

def calculateMonthlyInterestRate(annual_interest_rate):
    """This function calculates monthly interest
        given the annual interest rate.
    """
    if annual_interest_rate >= 0:
        return annual_interest_rate / 12
    else:
        monthly_interest_rate = 0
    return round(monthly_interest_rate, 2)

monthly_rate = calculateMonthlyInterestRate(.06)
print(monthly_rate)

이 파일을 Python 편집기로 불러왔어요.

이 연습은 강의의 일부입니다

케이스 스터디: Python으로 소프트웨어 만들기

강의 보기

실습형 인터랙티브 연습문제

이론을 실습으로 바꾸는 인터랙티브 연습 중 하나를 만나보세요

연습 시작