Commit 5c661adf by BellCodeEditor

auto save

parent 9289b601
Showing with 11 additions and 4 deletions
import turtle import turtle
#背景颜色
screen=turtle.Screen() screen=turtle.Screen()
screen.bgcolor("pink") screen.bgcolor("pink")
#写字
pen=turtle.Pen() pen=turtle.Pen()
pen.penup() pen.penup()
pen.goto(100,-100) pen.goto(100,-100)
pen.write("hi,依诺!好久不见啦\n用python写电子卡真好玩!",font=("Times",18,"normal")) pen.write("hi,依诺!好久不见啦\n用python写电子卡真好玩!",font=("Times",18,"normal"))
pen.hideturtle() pen.hideturtle()
#画爱心
pen1=turtle.Pen() pen1=turtle.Pen()
#设置画笔粗细和颜色
pen1.pensize(5) pen1.pensize(5)
pen1.pencolor("red") pen1.pencolor("red")
#设置变量
len=int(screen.textinput("提示","你想要多大的爱心呀?"))
pen1.left(45) pen1.left(45)
pen1.forward(100) pen1.forward(2*len)
pen1.circle(50,180) pen1.circle(len,180)
pen1.right(90) pen1.right(90)
pen1.circle(50,180) pen1.circle(len,180)
pen1.forward(100) pen1.forward(2*len)
pen1.hideturtle() pen1.hideturtle()
turtle.done() 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