Commit 09a606ef by BellCodeEditor

auto save

parent c2f1308f
Showing with 38 additions and 2 deletions
# 利用write()帮助悟空给诺依回信吧~ # 利用write()帮助悟空给诺依回信吧~
\ No newline at end of file #导入这个画笔工具包
import turtle
#创建画笔
pen1 = turtle.Pen()
pen1.hideturtle()
pen1.write("王邓小义你在干嘛?",font=("Times",5,"normal"))
turtle.done()
\ No newline at end of file
#导入这个画笔工具包
import turtle
pen1 = turtle.Pen()#创建画笔
pen1.penup() #抬笔
pen1.goto(100,-100) #移动到右下
screen1 = turtle.Screen() #创建画布角色
screen1.bgcolor("light blue") #设置画布的背景颜色
len1 = screen1.textinput("提示","您要画的爱心大小是多少?") #设置弹窗
lovesize = int(len1) #转换数据类型
pen1.hideturtle() #隐藏画笔的箭头
pen1.write("王邓小义你在干嘛?",font=("Times",15,"normal")) #写一段话,设置字体,字体大小...
pen2 = turtle.Pen() #创建画笔工具包
pen2.pensize(5) #设置画笔的大小
pen2.pencolor("red") #设置画笔的颜色
pen2.left(45) #画爱心
pen2.forward(2*lovesize)
pen2.circle(lovesize,180)
pen2.right(90)
pen2.circle(lovesize,180)
pen2.forward(2*lovesize)
#隐藏画笔箭头
pen2.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