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 編輯器。
本練習屬於課程
