Commit 87403346 by BellCodeEditor

save project

parent 18a396e7
Showing with 9 additions and 4 deletions
...@@ -2,6 +2,11 @@ pop={'生菜':3.01,'西瓜':5.5,'土豆':3.5} ...@@ -2,6 +2,11 @@ pop={'生菜':3.01,'西瓜':5.5,'土豆':3.5}
r=input('输入蔬菜') r=input('输入蔬菜')
m=input('蔬菜价格') m=input('蔬菜价格')
if r in pop: if r in pop:
if m<pop[r]: if float(m)<pop[r]:
pop[r]=int(m) pop[r]=str(m)
print() print(r+'我买')
\ No newline at end of file else:
print('我们不买')
else:
pop[r]=float(v)
print(pop)
\ 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