嗨我想知道我是否可以比我更好地整理我的代码.
基本上,答案会是这样是x = "£1,094.99 " 使用即时通讯x.strip()和x.strip("£")和x.replace(","),然后x = float(x) * 1.18以数字转换为欧元.
x = "£1,094.99 "
x.strip()
x.strip("£")
x.replace(",")
x = float(x) * 1.18
有什么方法可以提高效率?我是一个新手,所以我只是想知道.
python
python ×1