在 Python中,我可以使用“jump-step”对数组进行切片.例: In [1]: a = [1,2,3,4,5,6,7,8,9] In [4]: a[1:7:2] # start from index = 1 to index 7, with step = 2Out[4]: [2, 4, 6] Ruby能做到吗? a = [1,2,3,4,5,6,7,8,9]a.values_
在线咨询:
邮箱: xwei067@foxmail.com
工作时间:周一至周五,9:00-17:30,节假日休息