小编gio*_*aia的帖子

我怎样才能在变量中使用冒号(:)

我想写这样的代码:

index = 0:2
print(list[index])
Run Code Online (Sandbox Code Playgroud)

但这不起作用.

有什么办法可以将[...:...]语法的所有部分存储在变量中吗?

python variables list python-3.x

8
推荐指数
2
解决办法
1146
查看次数

标签 统计

list ×1

python ×1

python-3.x ×1

variables ×1