- 博客(2)
- 资源 (1)
- 收藏
- 关注
原创 python中dict内置函数使用fromkeys注意事项
在写一个创建用户以及用户登录时小程序发现fromkeys快速创建字典时如果第一个参数直接为单个字符串的话创建结果则会变成如下效果: num={} num=num.fromkeys(‘num’,1) num {‘n’: 1, ‘u’: 1, ‘m’: 1} 创建出来的结果将后面的value映射给了前面字符串中的每一个元素,通过查找python自带文档后,对该函数定义为如下: classm...
2019-11-12 23:59:59
331
原创 python中字符串内置函数expendtabs()理解
python中字符串内置函数expendtabs(tapsize=8)此函数在python文档中原文为: Return a copy of the string where all tab characters are replaced by one or more spaces, depending on the current column and the given tab size. Ta...
2019-10-29 23:03:13
475
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人