![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python知识补充
文章平均质量分 54
Marshal~
这个作者很懒,什么都没留下…
展开
-
【无标题】
关于Python itertools.groupby Python itertools.groupby groupby()把迭代器中相邻的,指定特征重复的元素挑出来放在一起 list中:key相同的dict元素 通常使用itemgetter()参数规定分组依据 也可编写简单的lambda函数传入key参数,作为分组依据(key参数必须传入函数) from operator import itemgetter #itemgetter用来取dict中的key,省去了使用lambda函数 from itertoo转载 2022-03-19 22:20:19 · 82 阅读 · 0 评论 -
python补充
1、round(2/3)会输出1,他是向最近的整数取整。而默认的2/3应该取为0,这是python默认的取整方式:向下取整。 2、floor(32.9)----32向下取整,ceil(32.9)-----33向上取整 3、字符串拼接"hello"+"world"就可以输出hello world 4、长字符串: print('''uiasfhaioushciuhcsxuhscasdiuchapcd asdcfhbasofhapsd asdfiahsdf''') print('uiasfhaioushciuhc原创 2021-11-28 10:25:57 · 462 阅读 · 0 评论