主页
Python
Python - 列表推导式
demo_list_comprehension_range2
运行 ❯
×
更改方向
保存代码
更改主题
newlist = [x for x in range(10) if x < 5] print(newlist)
[0,1,2,3,4]