python进阶(一)
2020-03-21 本文已影响0人
独孤蝴蝶
*args 和 **kwargs

例子:


生成器

实例:

第一种生成器方法,我们不用担心会使用大量的资源,
若使用第二种方法,在输入参数很大时,我们会耗尽所有的资源。
Map、Filter、Reduce

实例:

Set数据结构

三元运算符

*args 和 **kwargs
例子:
生成器
实例:
第一种生成器方法,我们不用担心会使用大量的资源,
若使用第二种方法,在输入参数很大时,我们会耗尽所有的资源。
Map、Filter、Reduce
实例:
Set数据结构
三元运算符