Commit d1365ecd by BellCodeEditor

save project

parent 5237b8dd
Showing with 13 additions and 13 deletions
# 这是悟空为花果山小猴做臂力测试的程序代码 cost={'苹果':5.2,'山竹':12.9,'香蕉':2.4,'荔枝':15,'葡萄':9.3,'桂圆':8,'蓝莓':10,'李子':8}
name=input('你叫啥名啊?') k=input('请输入水果名称:')
power=int(input('你臂力多少啊?')) v=input('请输入水果价钱:')
list_hero=['猴三',10,'猴一',21,'猴五',22,'猴队长',29,'猴七',30] if k in cost:
for i in range(len(list_hero)): int(v)>cost[k]
if i%2==1 and list_hero[i]>=power: cos[k]=int(v)
list_hero.insert(i-1,name) print(k+'降价了,现价'+v+'元')
list_hero.insert(i,power) else:
break print(k+'涨价了,我们不买')
print(list_hero) else:
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典 cost[k] = float(v)
dict_hero= print(k+'的价钱'+v+'元已上传')
print(dict_hero) \ 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