Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

拼写纠正lsit->list #14

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

Open
menng wants to merge 1 commit into walter201230:master
base: master
Choose a base branch
Loading
from menng:master
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Article/python7/3.md
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 三、lsit 生成式(列表生成式) #
# 三、list 生成式(列表生成式) #


## 1、创建 list 的方式 ##
Expand Down Expand Up @@ -44,7 +44,7 @@ print('\n'.join([' '.join ('%dx%d=%2d' % (x,y,x*y) for x in range(1,y+1)) for y

## 2、list 生成式的创建 ##

首先,lsit 生成式的语法为:
首先,list 生成式的语法为:

```python
[expr for iter_var in iterable]
Expand All @@ -61,8 +61,8 @@ print('\n'.join([' '.join ('%dx%d=%2d' % (x,y,x*y) for x in range(1,y+1)) for y

```python
# -*- coding: UTF-8 -*-
lsit1=[x * x for x in range(1, 11)]
print(lsit1)
list1=[x * x for x in range(1, 11)]
print(list1)
```

输出的结果:
Expand All @@ -75,8 +75,8 @@ print(lsit1)

```python
# -*- coding: UTF-8 -*-
lsit1= [x * x for x in range(1, 11) if x % 2 == 0]
print(lsit1)
list1= [x * x for x in range(1, 11) if x % 2 == 0]
print(list1)
```

输出的结果:
Expand All @@ -91,8 +91,8 @@ print(lsit1)

```python
# -*- coding: UTF-8 -*-
lsit1= [(x+1,y+1) for x in range(3) for y in range(5)]
print(lsit1)
list1= [(x+1,y+1) for x in range(3) for y in range(5)]
print(list1)
```

输出的结果:
Expand Down
2 changes: 1 addition & 1 deletion README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ IT 行业相对于一般传统行业,发展更新速度更快,一旦停止
* [迭代器和生成器](/Article/python7/Preface.md)
- [迭代](/Article/python7/1.md)
- [Python 迭代器](/Article/python7/2.md)
- [lsit 生成式(列表生成式)](/Article/python7/3.md)
- [list 生成式(列表生成式)](/Article/python7/3.md)
- [生成器](/Article/python7/4.md)
- [迭代器和生成器综合例子](/Article/python7/5.md)
* [模块与包](/Article/python8/Preface.md)
Expand Down

AltStyle によって変換されたページ (->オリジナル) /