def convertWeight(value, unit, unitToConvert) -> converterdWeight:
convertor = w(unit = 0)
unitValue = w(unit = value)
return convertor + unitValue
convertWeight(20, 'g', 'oz')
这使用了测量模块,它在函数中定义了一个变量,例如重量(kg=10)
我想让函数这样做,让参数这样做
def func(parameter):
weight(parameter = 10)
我该怎么做
我们发现:
Var现在是1
相关问题 更多 >
编程相关推荐