为什么报错
为啥报错? L = range(1, 101) print (L[0:10]) print (L[2:101:3]) print (L[4:51:5])
>>> Traceback (most recent call last): File "D:/python31/test1", line 3, in print (L[0:10]) TypeError: sequence index must be integer, not 'slice'
为啥报错? L = range(1, 101) print (L[0:10]) print (L[2:101:3]) print (L[4:51:5])
>>> Traceback (most recent call last): File "D:/python31/test1", line 3, in print (L[0:10]) TypeError: sequence index must be integer, not 'slice'
2016-03-30
举报