Commit 9af41492 by BellCodeEditor

save project

parent 4f329636
Showing with 5 additions and 4 deletions
...@@ -11,16 +11,17 @@ pen1=turtle.Pen() ...@@ -11,16 +11,17 @@ pen1=turtle.Pen()
pen1.pencolor("red") pen1.pencolor("red")
pen1.pensize(20) pen1.pensize(20)
pen1.fillcolor("red") pen1.fillcolor("red")
len=input("输入直线大小:")
pen1.penup() pen1.penup()
pen1.goto(-50,50) pen1.goto(-50,50)
pen1.pendown() pen1.pendown()
pen1.begin_fill() pen1.begin_fill()
pen1.left(45)#爱心初始角度 pen1.left(45)#爱心初始角度
pen1.forward(100)#爱心的直线1 pen1.forward(len)#爱心的直线1
pen1.circle(50,180)#爱心的半圆1 pen1.circle(len/2,180)#爱心的半圆1
pen1.right(90)#爱心半圆间的角度 pen1.right(90)#爱心半圆间的角度
pen1.circle(50,180)#爱心的半圆2 pen1.circle(len/2,180)#爱心的半圆2
pen1.forward(100)#爱心的直线2 pen1.forward(len)#爱心的直线2
pen1.hideturtle() pen1.hideturtle()
pen1.end_fill() pen1.end_fill()
turtle.done() turtle.done()
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