Commit 92f797a0 by BellCodeEditor

auto save

parent 0bb70a85
Showing with 80 additions and 14 deletions
import turtle as t
t.penup()
t.lt(90)
t.fd(100)
t.pendown()
t.rt(90)
t.fillcolor("red")
t.begin_fill()
t.circle(10,180)
t.circle(25,110)
t.lt(50)
t.circle(60,45)
t.circle(20,170)
t.rt(24)
t.fd(30)
t.lt(10)
t.circle(30,110)
t.fd(20)
t.lt(40)
t.circle(90,70)
t.circle(30,150)
t.rt(30)
t.fd(15)
t.circle(80,90)
t.lt(15)
t.fd(45)
t.rt(165)
t.fd(20)
t.lt(155)
t.circle(150,80)
t.lt(50)
t.circle(150,90)
t.end_fill()
t.lt(150)
t.circle(-90,70)
t.lt(20)
t.circle(75,105)
t.setheading(60)
t.circle(80,98)
t.circle(-90,40)
t.lt(180)
t.circle(90,40)
t.circle(-80,98)
t.setheading(-83)
t.fd(30)
t.lt(90)
t.fd(25)
t.lt(45)
t.fillcolor("green")
t.begin_fill()
t.circle(-80,90)
t.rt(90)
t.circle(-80,90)
t.end_fill()
t.rt(135)
t.fd(60)
t.lt(180)
t.fd(85)
t.lt(90)
t.fd(80)
t.rt(90)
t.rt(45)
t.fillcolor("green")
t.begin_fill()
t.circle(80,90)
t.lt(90)
t.circle(80,90)
t.end_fill()
t.lt(135)
t.fd(60)
t.lt(180)
t.fd(60)
t.rt(90)
t.circle(200,60)
t.up()
t.goto(100,-300)
t.write("Send you a flowr,bring you home")
t.done()
\ No newline at end of file
# 持家小能手 (利用自动更新成绩程序的逻辑完成这个新项目)
# 如果输入的水果价钱比字典中的低,则替换掉,反之则不更新
cost= {'苹果':5.2,'山竹':12.9,'香蕉':2.4,'荔枝':15,'葡萄':9.3,'桂圆':8,'蓝莓':10,'李子':8}
k=input('请输入水果名称:')
v=input('请输入水果价钱:')
# ?补充条件判断:
if # ?:
# ?更新价钱
print(k+'降价了,现价'+v+'元')
else:
print(k+'涨价了,我们不买')
else:
cost[k] = float(v)
print(k+'的价钱'+v+'元已上传~')
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