Ch5 first import is confusing

未關閉 適合新手
#191 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
1/5
預估耗時
1 小時以內
新手友好度
85/100
Issue 類型
文件
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
python
領域
documentation

研究方向

在 lc-python-intro 課程倉庫中定位第 5 章匯入部分的內容檔案。更新說明行,將 library_name.function 替換為 library_name.object,並將第一個程式碼範例替換為建議的程式碼片段,該片段同時演示函式呼叫(string.capwords)和匯入的字串物件使用(string.ascii_lowercase)。預覽建置後的課程,確認更改如預期顯示。

由索引模型根據 Issue 內容生成。

描述

How could the content be improved?

At the start of Ch5 "You must import a library or module before using it"

Use import to load a library into a program’s memory. Then you can refer to things from the library as library_name.function

Then the first thing you load in is string.ascii_lowercase which is not a function, it is a string!

Suggestion on how to resolve it:
Edit the text above so it is more general: "Then you can refer to things from the library as library_name.object"

Then have the code box be something like:

import string

# Using an imported function
print(string.capwords('capitalise this sentence please.'))
# Imported objects can also be strings, numbers, or other types of objects
print(f'The lower ascii letters are {string.ascii_lowercase}')
Which part of the content does your suggestion apply to?

Ch5 You must import a library or module before using it

主要語言
HTML
星號
25
分支
65
PR 合併指標
30 天內沒有已合併 PR

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

LibraryCarpentry/lc-python-intro 的其他 Issue

查看 LibraryCarpentry/lc-python-intro 的全部 Issue

相似的 Issue

更多 Documentation Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。