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

Commit 2618ad5

Browse files
Merge pull request walter201230#38 from 0xfreeman/master
list关键字错误
2 parents 979a6a5 + 3834ef4 commit 2618ad5

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎Article/PythonBasis/python7/3.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 三、lsit 生成式(列表生成式) #
1+
# 三、list 生成式(列表生成式) #
22

33

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

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

51-
首先,lsit 生成式的语法为:
51+
首先,list 生成式的语法为:
5252

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

6666
```python
6767
# -*- coding: UTF-8 -*-
68-
lsit1=[x * x for x in range(1, 11)]
69-
print(lsit1)
68+
list1=[x * x for x in range(1, 11)]
69+
print(list1)
7070
```
7171

7272
输出的结果:
@@ -79,8 +79,8 @@ print(lsit1)
7979

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

8686
输出的结果:
@@ -95,8 +95,8 @@ print(lsit1)
9595

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

102102
输出的结果:

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ IT 行业相对于一般传统行业,发展更新速度更快,一旦停止
7373
* [迭代器和生成器](/Article/PythonBasis/python7/Preface.md)
7474
- [迭代](/Article/PythonBasis/python7/1.md)
7575
- [Python 迭代器](/Article/PythonBasis/python7/2.md)
76-
- [lsit 生成式(列表生成式)](/Article/PythonBasis/python7/3.md)
76+
- [list 生成式(列表生成式)](/Article/PythonBasis/python7/3.md)
7777
- [生成器](/Article/PythonBasis/python7/4.md)
7878
- [迭代器和生成器综合例子](/Article/PythonBasis/python7/5.md)
7979
* [面向对象](/Article/PythonBasis/python8/Preface.md)

0 commit comments

Comments
(0)

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