手机随时阅读
新人专享大礼包¥24
L = ['Michael', 'Sarah', 'Tracy', 'Bob', 'Jack']>>> L[0:3]['Michael', 'Sarah', 'Tracy']L[0:3]表示,从索引0开始取,直到索引3为止,但不包括索引3。即索引0,1,2,正好是3个元素。Python支持L[-1]取...
Copyright © 2005-2022 51CTO.COM 版权所有 京ICP证060544号