元组
#元组(不可变的列表)
var = tuple()
var = ()
type(var) -->tuple
var = (1,2,3,4,5,[23,34,43])
var.count(1)#计算1出现的个数
var.index(5)#5所在的位置
字典
var = {}
var = dict()
type(var)
var = {
'中' : 100,
'左' : 200
}
var['中']
students = ['wong','li','sun','zhao','qian']
dict.fromkeys(students,10) ---> {'li': 10,'qian': 10,'sun': 10,'wong': 10,'zhao': 10}
money['wong'] -->10
money.keys() -->dict_keys(['wong','sun','qian','li','zhao'])
money.values()
---> dict_values([10,10,10,10,10])
money.items([('wong', 10),('sun',10),('qian',10),('li', 10),('zhao', 10)])
money.pop('wong')
money['guli'] = 100
money.setdefault('haha', 1000)
拉锁函数
words = ['中','左']
location = [100,200]
new_var = list(zip(words, location))
new_var ---> [('中',100),('左',200)]
dict(new_var) -->{'中': 100,'左': 200}
list(zip([1,2],[3,4,5],[4,5,5]))--->[(1,3,4),(2,4,5)]