selfteaching / selfteaching/selfteaching-python-camp

Day03 关于python代码缩进不当导致的问题

Open
#688 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
151
Forks
875
PR merge metrics
No merged PRs in 30d

Description

今天在测试代码时,出现了一些问题,请看以下两段代码:
代码1:
image
代码2:
image

乍看之下一模一样,反正我是没找到区别,但就是因为缩进问题,代码2无法执行。
大家有没有碰到类似的问题,有什么好的方法,是如何避免的,一起来讨论下啊。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Review the two code examples in the issue images and reproduce the execution difference in Python, then compare their indentation and the Day03 lesson context. Done when the whitespace difference and a clear way to avoid it are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.