Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From wpeiran #623

Closed
wants to merge 3 commits into from
Closed

From wpeiran #623

wants to merge 3 commits into from

Conversation

wpeiran
Copy link
Contributor

@wpeiran wpeiran commented Apr 13, 2019

表述错误:# 事实上相当于针对 range(2, n) 中每个 n 都执行了一次 print(n)
# for i in range(2, n):语句中每次被执行的变量是i,而打印的是n,因此表述有问题。
# 事实上是针对每次range(2, n)生成的等差数列的元素数量(相当于len(range(2,n)),去循环执行相应次数的print(n)。
# 在break语句不执行的情况下。如果break语句执行循环终止。

wpeiran added 3 commits April 10, 2019 08:42
表述错误:# 事实上相当于针对 range(2, n) 中每个 n 都执行了一次 print(n)
# for i in range(2, n):语句中每次被执行的变量是i,而打印的是n,因此表述有问题。
# 事实上是针对每次range(2, n)生成的等差数列的元素数量(相当于len(range(2,n)),去循环执行相应次数的print(n)。
# 在break语句不执行的情况下。如果break语句执行循环终止。
@xiaolai
Copy link
Contributor

xiaolai commented Apr 13, 2019

明白你的意思了,但,应该这么改:

“# 事实上相当于针对 range(2, n) 中每个 i 都执行了一次 print(n)“

即,把 ”每个 n“ 改成 ”每个 i“。

已经改过了。辛苦!

@xiaolai xiaolai closed this Apr 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants