a = slice(2, 7)
s = 'HelloWorld'
print(a.indices(len(s)))
for i in range(*a.indices(len(s))):
    print(s[i])

 

相关文章:

  • 2022-12-23
  • 2021-09-17
  • 2021-12-13
  • 2022-02-17
  • 2022-01-04
  • 2021-07-03
猜你喜欢
  • 2021-10-27
  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2021-09-08
  • 2022-03-03
相关资源
相似解决方案