Commit 5e7babeb by BellCodeEditor

auto save

parent b90a3eaf
Showing with 13 additions and 0 deletions
fruit = {"苹果":3.5, "香蕉":5, "西瓜":10}
while True:
today_fruit = input("输入水果:")
today_price = input("输入今日价格:")
if today_fruit in fruit:
if float(today_price)< fruit[today_fruit]:
print("水果降价了,之前的价格是"+str(fruit[today_fruit]))
else:
print("涨价了,我们不卖")
else:
fruit[today_fruit] = float(today_price)
print("您添加了"+today_fruit+"价格是"+today_price)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment