2024-04-20 01:04:54 发布
网友
我需要使用Python2.7输出下面的输入数据
这应该适合您:
import re your_string = "reth10.890" number = re.findall("\d+\.\d+", your_string) requested_string = re.sub(number[0], '', a) print(requested_string) >>>'reth'
如果字符串包含更多浮点数,则必须选择数字中的最后一个浮点数
这应该适合您:
如果字符串包含更多浮点数,则必须选择数字中的最后一个浮点数
相关问题 更多 >
编程相关推荐