标签:strong 个数 python字符串 javascrip 类型 rac int ide 重复
List(列表) 是 Python 中使用最频繁的数据类型, 类似于javaScript中的数组
listone = [ ‘abcd‘, 786 , 2.23, ‘Python‘, 70.2 ]
listtwo = [123, ‘Python‘]
print( listone) # 输出列表
print( listone[0] ) # 输出列表的第一个元素
print( listone[1:3]) # 输出列表下标1到3的列表元素
print( listone[2: ] # 输出列表下标为2及后面的所有列表元素
print( listone * 2) # 在一个数组里面重复输出数组两遍
print( listone + listtwo) # 数组进行相加输出
与Python字符串不一样的是,列表中的元素是可以改变的:
标签:strong 个数 python字符串 javascrip 类型 rac int ide 重复
原文地址:http://www.cnblogs.com/tenro/p/7663036.html