Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dfdcf7b

Browse files
authored
Update README.md
1 parent 951caed commit dfdcf7b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88
99
## 1.在列表,字典,集合中根据条件筛选数据
1010

11-
需求: 1. 过滤 list 中大于 0 的数:\[14, 0, -6, 0, -10, -8, -1, 19, -10, -16\] > 2. 筛选出字典中值大于 0 的项目:{0: 9, 1: -3, 2: -8, 3: 6, 4: -4, 5: -4, 6: -7, 7: -8, 8: 7, 9: -3} > 3. 筛选出集合中能被 2 整除的数:{3, 4, 9, 12, 15, 17, 19, 20} > 4. 找到字典中值最小的健值对:prices = {'ACME': 45.23,'AAPL': 612.78,'IBM': 205.55,'HPQ': 37.20,'FB': 10.75} > 5. 对字典排序,首先按照值排序,值相同再按照健排序 6. 对字典的健按照值排序
11+
需求:
12+
1. 过滤 list 中大于 0 的数:\[14, 0, -6, 0, -10, -8, -1, 19, -10, -16\];
13+
2. 筛选出字典中值大于 0 的项目:{0: 9, 1: -3, 2: -8, 3: 6, 4: -4, 5: -4, 6: -7, 7: -8, 8: 7, 9: -3};
14+
3. 筛选出集合中能被 2 整除的数:{3, 4, 9, 12, 15, 17, 19, 20};
15+
4. 找到字典中值最小的健值对:prices = {'ACME': 45.23,'AAPL': 612.78,'IBM': 205.55,'HPQ': 37.20,'FB': 10.75};
16+
5. 对字典排序,首先按照值排序,值相同再按照健排序;
17+
6. 对字典的健按照值排序;
1218

1319
```python
1420
list_bigger = [x for x in list_nums if x > 0]

0 commit comments

Comments
 (0)