price = float(input(“请输入苹果单价:”))
weight =float(input(“请输入重量:”))
money = price * weight
print(“苹果每斤 %.2f 元,苹果重量 %.2f 斤,总共花了 %.2f 元” % (price,weight,money))
Python :买苹果
最新推荐文章于 2023-03-01 23:57:46 发布
price = float(input(“请输入苹果单价:”))
weight =float(input(“请输入重量:”))
money = price * weight
print(“苹果每斤 %.2f 元,苹果重量 %.2f 斤,总共花了 %.2f 元” % (price,weight,money))