以自定义PE_ratio为例写文档def PE(Price,Earning): """Calculate PE ratio""" PE=Price/Earning return print(PE) -------------------- PE.__doc__ 'Calculate PE ratio'lambda表达式创建一个匿名函数在函数中包函数用到的比较多更加简洁super_add = lambda num1, num2: num1+num2 print(super_add(120,230)) ------------------------- 350高阶内置函数filter()批量删选虚假姓名filter(n,m)n为筛选条件m为需要筛选的元素names = ['Tom', 'William', 'Mokey DDDDDDDDDD Lufy', 'Mary',
一只胖橘