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エディタに読み込みました。
この演習はコースの一部です
