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 편집기로 불러왔어요.
이 연습은 강의의 일부입니다
