Commit b89c2bbc by BellCodeEditor

save project

parent da026615
Showing with 8 additions and 8 deletions
c = {'a':2,'b':7,'c':4}
k = input("你要买什么")
n = input("要几个")
if k in c:
print("总共"+k+"要"+str(c[k]*int(n))+"元~")
else:
print("缺货了")
\ No newline at end of file
cost={'苹果':5.2,'山竹':12.9,'香蕉':2.4,'荔枝':15,'葡萄':9.3,'桂圆':8,'蓝莓':10,'李子':8}
j = input("请输入水果名称:")
b = input("请输入水果价钱:")
if j in cost:
if cost[x] < float(b):
cost[x] = float(b)
print(j+'降价了,现价'+b+'元')
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