1
a87150 2016 年 9 月 27 日
自己写几个函数就行了吧,你是懒到什么地步
|
2
wjidea 2016 年 9 月 27 日
提供一个思路, 用 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 2016 年 9 月 27 日
你发帖的时间 长度转换就已经写完了
|
4
woostundy 2016 年 9 月 28 日
英制转公制好转,乘以系数就行。
美元转人民币可复杂了,汇率很复杂。 |