Commit 8fb8fb98 by BellCodeEditor

auto save

parent c2f1308f
Showing with 33 additions and 2 deletions
# 利用write()帮助悟空给诺依回信吧~ # 利用write()帮助悟空给诺依回信吧~
\ No newline at end of file
import turtle #载入turtle画图工具包
pen = turtle.Pen()#调用Pen()方法创建新的画笔,并赋值给变量pen
#抬笔
pen.penup()
#将写字初始点移到(100,-100)的地方
pen.goto(100,-100)
pen.write("你们这些傻子,\n叫你们做笔记不做笔记,\n还好意思打代码",font=("Times",20,"bold"))
pen.hideturtle()#调用hideturtle()方法隐藏画笔标识
#画爱心
sc = turtle.Screen()#创建幕布,并赋值给变量sc
#改变背景颜色淡蓝色
sc.bgcolor("light blue")
pen1 = turtle.Pen()
pen1.pensize(5)#设置画笔的大小
pen1.pencolor("red")#设置画笔的颜色
#画爱心的下边
pen1.left(45)
pen1.forward(100)
#画第一个半圆
pen1.circle(50,180)
#画第二个半圆
pen1.right(90)
pen1.circle(50,180)
#画爱心的另一个下边
pen1.forward(100)
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