Python
Catdingwt
这个作者很懒,什么都没留下…
展开
-
TabError: inconsistent use of tabs and spaces in indentation
Python对缩进敏感,如果混用tab和空格 即使空格数是相同的,也会报这样的错误,需要统一缩进的方式。原创 2018-06-06 21:21:06 · 571 阅读 · 0 评论 -
Python实现字符串转换成浮点型数字
使用Python实现float函数from functools import reducedigits = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9}def char2num(s): return digits[s]def str2int(s): retu...原创 2018-06-07 20:56:13 · 7394 阅读 · 1 评论