标签:rem remove color move too nbsp find return exp
from functools import reduce import re def remove_addsub(exp): s=re.findall("[+-]?\d+(?:\.\d+)?",exp) return reduce(lambda a,b:float(a)+float(b),s) s=remove_addsub("6+9+45+459+85") print(s)
标签:rem remove color move too nbsp find return exp
原文地址:https://www.cnblogs.com/rxybk/p/13269669.html