码迷,mamicode.com
首页 > 其他好文 > 详细

List operations

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

标签:style   blog   http   strong   2014   art   

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

标签:style   blog   http   strong   2014   art   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!