selfteaching / selfteaching/selfteaching-python-camp

Day04 关于如何使用条件判断去除乘法表偶数行的问题

Open
#1,869 6 comments 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

在操作时,发现运行以后第一列的偶数行还完整的留着,其余列的偶数行全都去除了;

i = 1
while i < 10:
       j = 1
       while j < i + 1:
              print(j,  ‘*’,i, ‘=’, i * j, sep=‘’,end=‘\t’)
              j += 1
              if i%2 == 0:
                    break
       print()
       i += 1

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 with the nested while loops in the Python example included in the issue, focusing on the conditional and the loop-control statement. Reproduce the output and compare the first column with the remaining columns; done means the lesson clearly explains the observed behavior and the intended even-row result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
content, documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.