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