# 提示苹果单价
price = float(input("苹果单价:"))
# 苹果重量
weight = float(input("苹果重量:"))
money = price * weight
print(money)
在原先的基础上进行优化,并且在减少了代码数量的同时使得代码更简单
# 提示苹果单价
price = float(input("苹果单价:"))
# 苹果重量
weight = float(input("苹果重量:"))
money = price * weight
print(money)
在原先的基础上进行优化,并且在减少了代码数量的同时使得代码更简单