Commit a5a41c4c by BellCodeEditor

save project

parent c66a449e
Showing with 29 additions and 2 deletions
...@@ -9,7 +9,7 @@ pen.write("你好\nSB.",font=("Times",30,"normal")) ...@@ -9,7 +9,7 @@ pen.write("你好\nSB.",font=("Times",30,"normal"))
pen.hideturtle() pen.hideturtle()
len=60 len=60
pen.penup() pen.penup()
pen.goto(100,100) pen.goto(100,-100)
pen.pendown() pen.pendown()
pen.pensize(5) pen.pensize(5)
pen.pencolor("red") pen.pencolor("red")
...@@ -19,4 +19,4 @@ pen.circle(len,180) ...@@ -19,4 +19,4 @@ pen.circle(len,180)
pen.right(90) pen.right(90)
pen.circle(len,180) pen.circle(len,180)
pen.forward(2*len) pen.forward(2*len)
turtle.done() turtle.done()
\ No newline at end of file
#导入turtle模块
import turtle
#创建画笔
pen=turtle.Pen()
#导入正文
screen=turtle.Screen()
len=int(screen.textinput("提示","请输入半径"))
screen.bgcolor("pink")
pen.penup()
pen.goto(100,-100)
pen.write("诺依,\nturtle真好用,\n我会在画布上写字啦!",font=("Times",30,"normal"))
#隐藏画笔
pen.hideturtle()
#画爱心
pen=turtle.Pen()
pen.pensize(10)
pen.pencolor("red")
pen.left(45)
pen.forward(len*2)
pen.circle(len,180)
pen.right(90)
pen.circle(len,180)
pen.forward(len*2)
pen.hideturtle()
turtle.done()
\ 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