Commit 71a650fc by BellCodeEditor

save project

parent 06917293
Showing with 11 additions and 7 deletions
baihuo={'巧克力':6,'可乐':3,'薯片':4,'农夫山泉':1} chengji={'张三':80,'李四':43,'王五':97,'老六':76}
k=input("你要买哪种商品:") k=input("你的名字是什么:")
shu=int(input("你要买多少个:")) v=int(input("你的成绩是多少:"))
if k in baihuo: if k in chengji:
print('你要买的'+k+'需要'+str(baihuo[k]*shu)+'元') if v>chengji[k]:
print('你的成绩被刷新了,目前成绩为'+str(v)+'分')
else:
print('很遗憾,你的成绩没有被刷新')
else: else:
print("你要买的商品不在售货机里面") chengji[k]=v
\ No newline at end of file print('你的第一次成绩已经被添加,目前成绩为'+str(v)+'分')
\ 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