#遍历 info = {'key1':'value1','key2':'value2','key3':'value3'} #方式一 for i in info: print(i,info[i]) #方式二 for key,value in info.items(): print(key,value) li = [1,2,3,5,4,7,9,7]for index,v in enumerate(li): print(index,v) 函数: *定义函数,函数体不执行,只有调用函数时,函数体才执行.…