1
a87150 Sep 27, 2016
自己写几个函数就行了吧,你是懒到什么地步
|
2
wjidea Sep 27, 2016
提供一个思路, 用 Python dict 来实现。
SI = {'mm':0.001, 'cm':0.01, 'm':1.0, 'km':1000} def convert_SI(val, unit1, unit2): return val*SI[unit1]/SI[unit2] http://stackoverflow.com/questions/32091117/simple-unit-converter-in-python |
3
sherlocktheplant Sep 27, 2016
你发帖的时间 长度转换就已经写完了
|
4
woostundy Sep 28, 2016
英制转公制好转,乘以系数就行。
美元转人民币可复杂了,汇率很复杂。 |