Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

bellcode / lesson8-5

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit 12e38397 authored 4 months ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent a49ce297
Show whitespace changes
Inline Side-by-side
Showing with 60 additions and 14 deletions
  • diy.py
  • kioaxnkjjkqbjkdhjkbidhquiudhqui.py
diy.py
View file @ 12e38397
# 持家小能手 (利用自动更新成绩程序的逻辑完成这个新项目) import turtle
# 如果输入的水果价钱比字典中的低,则替换掉,反之则不更新 pen = turtle.Pen()
cost= {'苹果':5.2,'山竹':12.9,'香蕉':2.4,'荔枝':15,'葡萄':9.3,'桂圆':8,'蓝莓':10,'李子':8} pen.fillcolor('red')
k=input('请输入水果名称:') pen.begin_fill()
v=input('请输入水果价钱:') pen.goto(-400,0)
# ?补充条件判断: pen.forward(200)
if # ?: pen.right(144)
# ?更新价钱 pen.forward(200)
print(k+'降价了,现价'+v+'元') pen.right(144)
else: pen.forward(200)
print(k+'涨价了,我们不买') pen.right(144)
else: pen.forward(200)
cost[k] = float(v) pen.right(144)
print(k+'的价钱'+v+'元已上传~') pen.forward(200)
pen.right(144)
pen.forward(400)
pen.right(144)
pen.forward(200)
pen.right(144)
pen.forward(200)
pen.right(144)
pen.forward(200)
pen.right(144)
pen.forward(200)
pen.right(144)
pen.forward(400)
pen.right(144)
pen.forward(200)
pen.right(144)
pen.forward(200)
pen.right(144)
pen.forward(200)
pen.right(144)
pen.forward(200)
pen.right(144)
pen.forward(400)
pen.right(144)
pen.forward(200)
pen.right(144)
pen.forward(200)
pen.right(144)
pen.forward(200)
pen.right(144)
pen.forward(200)
pen.right(144)
pen.hideturtle()
pen.end_fill()
turtle.done()
\ No newline at end of file
This diff is collapsed. Click to expand it.
kioaxnkjjkqbjkdhjkbidhquiudhqui.py 0 → 100644
View file @ 12e38397
import turtle
pen = turtle.Pen()
pen.fillcolor('green')
pen.begin_fill()
pen.speed(0)
for i in range(360):
pen.forward(400)
pen.left(123445073087068729835702345)
pen.end_fill()
turtle.done()
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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