selfteaching / selfteaching/selfteaching-python-camp

Day04 当代码中有两段或多个互不相关的代码时,调试的办法

Open
#216 2 comments 3 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. 把第一段代码先注释掉,注释的代码是不会运行的,每次只运行第二段代码

  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

Start by reviewing the Day04 assignment and the existing lesson structure to determine where this debugging guidance belongs. Done means the material clearly explains how to work on separate code sections and when to run them together, with the final location and scope agreed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.