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

bellcode / lesson3-1-1_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-1-1_DIY1
  • diy1.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    auto save · 414c4f67
    BellCodeEditor committed 4 years ago
    414c4f67
diy1.py 828 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# 利用write()帮助悟空给诺依回信吧~
import turtle#导入模块
pen = turtle.Pen()#拿一支笔出来
screen = turtle.Screen()#
screen.bgcolor("pink")
lovesize = int(screen.textinput("标题","请输入爱心的半径"))
pen.penup()#把笔抬起来
pen.goto(100,-100)#把笔移到到指定的位置
pen.write("诺依,你好",font=("楷体",20,"normal")) #用笔写字
pen1 = turtle.Pen()#又拿一支笔出来
pen1.pensize(5)#设置笔的大小
pen1.pencolor("red")#设置笔的颜色
pen1.left(45)#把笔左转
pen1.forward(lovesize*2)#让笔移到
pen1.circle(lovesize,180)#让笔画圆,第一个是半径,第二个是角度
pen1.right(90)#让笔右转
pen1.circle(lovesize,180)#让笔画圆,第一个是半径,第二个是角度
pen1.forward(lovesize*2)#让笔移到
turtle.done()#完成