Commit 71a97feb by BellCodeEditor

save project

parent e2bfd5e5
Showing with 9 additions and 12 deletions
# 这是悟空为花果山小猴做臂力测试的程序代码
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典
dict_hero={'猴三':10,'猴一':21,'猴五':22,'猴队长':29,'猴七':30}
print(dict_hero['猴队长'])
dict_hero['猴七']=32
dict_hero['猴十']=25
print(dict_hero)
\ No newline at end of file
baihuo={'巧克力':6,'可乐':3,'薯片':4,'农夫山泉':1}
k=input("你要买哪种商品:")
shu=int(input("你要买多少个:"))
if k in baihuo:
print('你要买的'+k+'需要'+str(baihuo[k]*shu)+'元')
else:
print("你要买的商品不在售货机里面")
\ 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