L = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 88)]
print(sorted(L,key=lambda i:i[0])) #按名字排序
print(sorted(L,key=lambda i:i[1])) #按成绩排序
.count(??) :检索
def f (??):
while True:
yield n:迭代器,返回n,继续执行
map:映射函数类型
>>> list(map(lambda x: x * x, [1, 2, 3, 4, 5, 6, 7, 8, 9]))
[1, 4, 9, 16, 25, 36, 49, 64, 81] #lambda 匿名函数
>>> import sys
>>> sys.path.append('/Users/michael/my_py_scripts')# 添加导入模块路径
import random
print random.random() #输入0-1之间的随机数
print random.uniform(10,20) #输出10-20之间的随机数
print random.randint(10,20) #输出10-20之间的随机整数
list_a = ['','','','']
list_b = ['','','','']
c= dict(zip(list_a,list_b)) #列表转化为字典