def weight_converter(gram): total_weight = gram / 1000 return str(total_weight) + ‘KG‘ the_weight = weight_converter(3000) print(the_weight)
Learn Python 014: Funtions
原文:http://www.cnblogs.com/mxyzptlk/p/7192242.html