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

bellcode / lesson3-5-2_DIY1

  • 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
Switch branch/tag
  • lesson3-5-2_DIY1
  • bug.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    save project · 4f9a6605
    BellCodeEditor committed 4 years ago
    4f9a6605
bug.py 622 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#导入turtle模块
import turtle
#背景颜色
screen=turtle.Screen()
screen.bgcolor("light blue")
pen=turtle.Pen()
pen.pencolor("red")
pen.pensize(5)
#画爱心
def love(len):
    pen.left(45)
    pen.forward(2*len)
    pen.circle(len,180)
    pen.right(90)
    pen.circle(len,180)
    pen.forward(2*len)
size=int(turtle.textinput("提示1","你想要多大的爱心?"))
love(size)
pen.hideturtle()
#写文字
pen1=turtle.Pen()
pen1.pencolor("purple1")
pen1.penup()
pen1.goto(-100,-100)
text=turtle.textinput("提示2","你想要写什么?")
pen1.write(text,font=("Time",18,"normal"))
pen1.hideturtle()
turtle.done()