首页 > 其他 > 详细

List operations

时间:2014-07-13 19:41:42      阅读:244      评论:0      收藏:0      [点我收藏+]

The + operator concatenates lists:

 bubuko.com,布布扣                      

Similarly, the * operator repeats a list a given number of items:

 bubuko.com,布布扣

List slices

The slice operator also works on lists:

 bubuko.com,布布扣

If you omit the first index, the slice starts at the beginning. If you omit the second, the slice goes to the end. So if you omit both, the slice is a copy of the whole list.

 

from Thinking in Python

List operations,布布扣,bubuko.com

List operations

原文:http://www.cnblogs.com/ryansunyu/p/3841107.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!