Day7 「生成式和生成器」 代码报错,可以优化一下以便初学者
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 92/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- python
- Domain
- documentation
Research direction
Open 「07.字符串和常用数据结构.md」 and locate the 「生成式和生成器」 examples. Run the example through print(sys.getsizeof(f)) and add the missing sys import at the beginning; done means the example runs without the reported NameError.
Written by the indexing model from the issue text.
Description
「07.字符串和常用数据结构.md」中「生成式和生成器」 的示例代码用到了 sys 模块的函数,所以程序执行到 print(sys.getsizeof(f)) 这一步时会报如下错误:
Exception has occurred: NameError
name 'sys' is not defined
需要在开头加上 import sys 或者 from sys import getsizeof
今天7号刚好学到第7天的教程,希望能早点学完~
- Dominant language
- Jupyter Notebook
- Stars
- 187k
- Forks
- 55.8k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jackfrued/Python-100-Days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
jackfrued/Python-100-Days#1215 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
jackfrued/Python-100-Days#1203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
jackfrued/Python-100-Days#1200 · 2 comments ·
-
Day81部分文本表述模糊/有误 Open
Difficulty 1/5 Under an hour Newbie friendliness 78/100
jackfrued/Python-100-Days#1192 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
jackfrued/Python-100-Days#1186 ·
All issues in jackfrued/Python-100-Days
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Ecosystem: ClawMetry — the Qwen Code reader is now free and open source (follow-up to #9294 / #9338) Opencategory/integration priority/P3 scope/documentation status/ready-for-human type/feature-request
Difficulty 1/5 Under an hour Newbie friendliness 84/100