Commit cb10534d by BellCodeEditor

save project

parent 1a2a6575
Showing with 18 additions and 8 deletions
# 神奇百货中的物品已经帮你创建好啦,接下来要看你的了~
dict= {'可口可乐':3,'旺仔牛奶':4,'农夫山泉':1,'辣条':3,'巴西烤肉':2,'果冻':4,'乐事':5,'奥利奥':10,'巧克力':6}
s=input("你想要什么")
d=input("你想要几个")
if s in dict:
print(s+"的价格"+str(dict[s]*int(d)))
else:
print(s+"缺货")
\ No newline at end of file
# dict= {'可口可乐':3,'旺仔牛奶':4,'农夫山泉':1,'辣条':3,'巴西烤肉':2,'果冻':4,'乐事':5,'奥利奥':10,'巧克力':6}
# s=input("你想要什么")
# d=input("你想要几个")
# if s in dict:
# print(s+"的价格"+str(dict[s]*int(d)))
# else:
# print(s+"缺货")
dict_shuiguo = {'苹果':2.4,'香蕉':3.5,'橘子':3.1}
a=input('请输入水果名称')
d=input('请输入水果价格')
if a in dict_shuiguo:
if flout(b)<dict_shuiguo[a]
dict_shuiguo[a]=flout(b)
print(str(a)+"降价了")
else:
print("涨价了,我们不买")
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