python获取数组元素的几种方法
L = ['spam', 'Spam', 'SPAM!'] print L[2] # offsets start at zero print L[-2] # negative: count from the right print L[1:] # slicing fetches sections
python获取数组元素的几种方法
L = ['spam', 'Spam', 'SPAM!'] print L[2] # offsets start at zero print L[-2] # negative: count from the right print L[1:] # slicing fetches sections