摘要: *args是可变长参数,在函数内部以tuple形式存储; >>> fun_var_args(1, 'two', 3)arg: 1<type 'tuple'> >>>fun_var_args(1, "two",3) arg: 1another arg: twoanother arg: 3 对于参数** 阅读全文
posted @ 2018-06-12 14:42 Apollo_zhanghongbo 阅读(252) 评论(0) 推荐(0) 编辑
摘要: Counter可以用来统计list中有哪些元素,每个出现多少次; defaultdict中指定value的类型后,比如指定为int,则对于没有出现过的key,其value为0,而不是报错;(value类型还能指定为list,则没出现过的key,其value为[]); OrderedDict中可以进行 阅读全文
posted @ 2018-06-12 14:27 Apollo_zhanghongbo 阅读(221) 评论(0) 推荐(0) 编辑