# -*- coding: utf-8 -*- from functools import reduce def str2float(s): float_len = len(s.split('.')[1]) nums = reduce(lambda x, y: x * 10 + y, map(lambda x: int(x), s.replace('.', ''))) return nums / (10 ** float_len)
Sign in to make a reply
我是code呀