Commit 7f6a36a0 by BellCodeEditor

save project

parent 7ad57c73
Showing with 12 additions and 18 deletions
dict={'可口可乐':3,'旺仔牛奶':4,'农夫山泉'1} goods={'可口可乐'3,'旺仔牛奶':4,'农夫山泉':1}
j=input('你要买什么?') goods.pop('农夫山泉')
num=int(input('请问您要购买几个')) print(goods)
if j in dict: \ No newline at end of file
print('您要的商品'+j+'价格为',dict[j],'元')
print('您一共消费',dict[j]*num,'元')
else
print('您要的商品'+j+'暂时缺货')
\ No newline at end of file
weather={'北京':8,'上海':15,'广州':20,'深圳':21}
del weather
print(weather)
\ No newline at end of file
python1={'王':99,'李':98,'星':100,'颜':80} goods={'可口可乐'3,'旺仔牛奶':4,'农夫山泉':1}
python1['颜']=100 goods.pop('农夫山泉')
print(python1['颜']) print(goods)
if '刘'in python1:
print(python1)
else:
python1['刘']=80
print(python1)
\ 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