Ch10 Variable scope has confusing variable name
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 88/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
在课程源代码中找到第10章的变量作用域剧集(在仓库中搜索 calc_fine 或 initial_fine 以找到准确的Markdown文件)。应用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
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
LibraryCarpentry/lc-python-intro 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
-
难度 1/5 1 小时以内 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 1/5 1 小时以内 新手友好度 76/100
-
难度 1/5 1 小时以内 新手友好度 88/100
查看 LibraryCarpentry/lc-python-intro 的全部 Issue
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 76/100
416rehman/Guardrails#1716 ·
-
难度 1/5 1-3 小时 新手友好度 72/100
-
area:kubernetes area:security documentation priority:medium size:small
难度 1/5 1-3 小时 新手友好度 88/100
RonaldHensbergen/composable-data-stack#1339 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 85/100
hugomrdias/playwright-test#786 · 1 条评论 ·
维护者通常 1 天内回复