编写 Python 程序,将厘米转换为米和公里。这个 Python 示例允许输入厘米,并将其转换为千米和米。我们知道,一米等于 100 厘米,一公里等于 10 万厘米。
# Centimeter to Meters and Kilometers
centimeter = float(input("Please Enter the Centimeters = "))
meter = centimeter/100
kilometers = centimeter/100000
print("%.2f Centimeters = %.2f Meters" %(centimeter, meter))
print("%.2f Centimeters = %.2f Kilometers" %(centimeter, kilometers))
原创文章,作者:G6OR4,如若转载,请注明出处:https://www.506064.com/n/127383.html