主页
Python
Python slice() 函数
demo_ref_slice
运行 ❯
×
更改方向
保存代码
更改主题
a = ("a", "b", "c", "d", "e", "f", "g", "h") x = slice(2) print(a[x])
('a', 'b')