Python 计算快递计价重量:体积重量与实际重量取最大值
def calculate_weight(length, width, height, real_weight): volume_weight = length * width * height / 12000 charge_weight = max(volume_weight, real_weight) return charge_weight
length = 80 width = 40 height = 15 real_weight = 2 charge_weight = calculate_weight(length, width, height, real_weight) print('The charge weight is:', charge_weight)
原文地址: https://www.cveoy.top/t/topic/mlng 著作权归作者所有。请勿转载和采集!