字符串轉浮點數 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
相關文章
相關標籤/搜索