Python包含6种内建序列:
列表
元组
字符串
Unicode字符串
buffer对象
xrange对象
----
索引
#字符串可以直接使用索引,不需要专门的变量引用
>>> 'Hello World...数据的一些细微区别
num = [1,2,3,4,5,6,7,8,9,10]
num1 = num[-1] # 输出:10 type:int
num2 = num[-1:]# 输出:[10] type:list
总结...TypeError: can only concatenate tuple (not "str") to tuple
var4 = var1 + (4,5,6) # (1, 2, 3, 4, 5, 6)
总结