苹果
#Apple.py
1.# 输入苹果的单价
price_str=input("请输入苹果的单价:")
2.#输入苹果的重量
weight_str=input("请输入苹果的重量:")
3.#将苹果的单价转换为小数
price=float(price_str)
4.#将苹果的重量转换为小数
weight=float(weight_str)
5.#总价=单价*数量
s_price=price*weight
6.#将苹果的总价转换为小数
sx_price=float(s_price)
print("苹果的总价:")
print(sx_price)