Striding slice?

Bengt Richter bokr at accessone.com
Sun Aug 26 15:46:47 EDT 2001


 >>> a='0123456789'
 >>> a[0:5]
 '01234'
 >>> a[0:5:2]
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
 TypeError: sequence index must be integer
 >>>

How about (faked example):
 >>> a[0:5:2]
 '024'
?




More information about the Python-list mailing list