Commit c0561e6c by BellCodeEditor

auto save

parent c816b9b8
Showing with 25 additions and 0 deletions
import turtle
import random
screen = turtle.Screen()
screen.bgcolor('pink') #背景颜色
pen = turtle.Pen()
# x = random.randint(50,200) #随机爱心大小
x = screen.textinput('爱心大小','请输入:') #弹窗
x = int(x)
print(x)
pen.color('red')
pen.begin_fill()
pen.left(45)
pen.forward(x)
pen.circle(x/2,180)
pen.right(90)
pen.circle(x/2,180)
pen.forward(x)
pen.end_fill()
pen.up()
pen.goto(100,-100)
pen.write('我爱你!\n笨蛋\n哈哈',font = ('微软雅黑',int(x/10),'normal'))
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