Ch10 Variable scope has confusing variable name

オープン 初心者向け
#196 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@chennesy がすでに取り組んでいます。

2026年10月7日 から。

  • #197 @chennesy による — オープン

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
88/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
documentation

調査の方向性

レッスンのソースコード内にあるCh10の変数スコープのエピソードを探してください(正確なMarkdownファイルを見つけるために、リポジトリ内で calc_fine または initial_fine を検索してください)。Issueで提案されたリネームを適用し、days_overdue が日数カウントのまま残り、結果が独自の名前を持つようにしてください。エピソード内でパラメータの再代入がなく、レンダリングされた例が一貫しており、古いパターンの他の出現が残っていない状態で完了です。

索引モデルが issue の本文から書いたものです。

説明

How could the content be improved?

Ch0 Variable scope section has this code:

initial_fine = 0.25
late_fine = 0.50

def calc_fine(days_overdue):
    if days_overdue <= 10:
        days_overdue =  days_overdue * initial_fine
    else:
        days_overdue = (days_overdue * initial_fine) + (days_overdue * late_fine)
    return days_overdue

There are two different uses of days_overdue, one of which would be measured in days, and one of which would be measured in dollars (pounds for us!). It would be better as something like:

def calc_fine(days_overdue):
    if days_overdue <= 10:
        total_fine =  days_overdue * initial_fine
    else:
        total_fine = (days_overdue * initial_fine) + (days_overdue * late_fine)
    return total_fine
Which part of the content does your suggestion apply to?

Ch10 Variable scope

主要言語
HTML
スター
25
フォーク
65
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

LibraryCarpentry/lc-python-intro のほかの issue

LibraryCarpentry/lc-python-intro の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。