始める無料で始める

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でソフトウェアを構築する

コースを見る

実践的なインタラクティブ演習

理論を実践に変える、インタラクティブな演習のひとつをお試しください

演習を開始する