Manipulate lists with list comprehensions.
这个提交包含在:
父节点
65264ff543
当前提交
bfef8d1013
@ -294,6 +294,12 @@ can_ride_coaster = [height for height in heights if height > 161]
|
||||
print(can_ride_coaster)
|
||||
```
|
||||
|
||||
You can manipulate lists with list comprehensions as well:
|
||||
|
||||
```
|
||||
fahrenheit = [celsius * (9 / 5) + 32 for celsius in celsius]
|
||||
```
|
||||
|
||||
## Ranges
|
||||
|
||||
You can get a range of numbers using `range()`
|
||||
|
||||
正在加载...
x
在新工单中引用
屏蔽一个用户