Skip to content

Commit cb8e850

Browse files
author
guozhen3
committed
index
1 parent 7dd393d commit cb8e850

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,31 @@
1919

2020
通过一行代码,体会Python语言简洁之美
2121

22-
1) 一行代码交换`a`,`b`
22+
1) 交换`a`,`b`
2323

2424
```python
2525
a, b = b, a
2626
```
2727

28-
2) 一行代码反转列表
28+
2) 反转列表
2929

3030
```python
3131
[1,2,3][::-1] # [3,2,1]
3232
```
3333

34-
3) 一行代码合并两个字典
34+
3) 合并两个字典
3535

3636
```python
3737
{**{'a':1,'b':2}, **{'c':3}} # {'a': 1, 'b': 2, 'c': 3}
3838

3939
```
40-
4) 一行代码去重
40+
4) 列表去重
41+
4142
```python
4243
set([1,2,2,3,3,3]) # {1, 2, 3}
4344
```
4445

45-
5) 一行代码找出多个列表中的最大值
46+
5) 多个列表中的最大值
4647

4748
```python
4849
max(max([ [1,2,3], [5,1], [4] ], key=lambda v: max(v))) # 5

0 commit comments

Comments
 (0)