同事在网上做题碰到的

>>> items = [0,1,2,3,4,5,6,7,8,9]
>>> a = _____(2,4)
>>> items[2:4]
[2, 3]
>>> items[a]
[2, 3]

前段时间看cookbook刚好碰到过:slice对切片命名

a = slice(2,4)

相关文章:

  • 2021-10-19
  • 2021-12-06
  • 2022-12-23
  • 2021-10-24
  • 2021-04-11
  • 2021-09-09
  • 2021-08-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
  • 2022-02-16
  • 2021-12-15
  • 2022-12-23
相关资源
相似解决方案