假设我有如下列表:
lst = [0,10,20,30,40,50,60,70]
我想要按循环顺序从 lst 从index = 5到 的元素。index = 2
index = 5
index = 2
lst[5:2]产量[] 我想要的lst[5:2] = [50,60,70,0,10]。有没有简单的库函数可以做到这一点?
lst[5:2]
[]
lst[5:2] = [50,60,70,0,10]
python list cycle python-itertools
cycle ×1
list ×1
python ×1
python-itertools ×1