dict

Special function

reduce(function,list),  依次对每两个元素应用function

Ex:  a = reduce(lambda x,y:x+y, [1,2,3,4]),  就是对 [1,2,3,4] 求和

注意前面一定要有 a= 


dict 

1. 从list 建, a = dict.fromkeys([1,2,3], [4,5,6])

                 =>   a = {1:[4,5,6], 2:[4,5,6], 3:[4,5,6]}



你可能感兴趣的:(Foundation)