字符串转浮点数 str2float (python版本)

利用map和reduce编写一个str2float函数,把字符串'123.456'转换成浮点数123.456:python # -*- coding: utf-8 -*- from functools import reduce def str2float(s): def char2num(s): return {'0': 0, '1': 1, '2': 2, '3': 3
相关文章
相关标签/搜索