Commit 037d86b3 by BellCodeEditor

save project

parent 07858a54
Showing with 31 additions and 0 deletions
# 利用write()帮助悟空给诺依回信吧~
import turtle #导入turtle模块
s=turtle.Screen()#新建画布
s.bgcolor("lightpink")#改变画布的背景颜色
size=s.textinput("???","你想要多大的爱心?")
len=int(size)
name=s.textinput("???","静夜思是谁写的?")
A=turtle.Pen()#新建画笔
A.penup() #抬笔
A.goto(80,-100) #移动的要写字的位置
A.write("静夜思\n唐["+name+"]\n床前明月光\n疑是地上霜",font=("STKAITI",20,"normal"))
#写字(“要写的内容”,字体变量=(“字体名称”,字体大小,“字体类型”))
A.hideturtle()#隐藏画笔
a=turtle.Pen()#新建画笔
a.penup()#抬笔
a.goto(-50,-100)
a.pendown()#落笔
a.pensize(3)#设置画笔粗细
a.pencolor("red")#设置画笔颜色
a.left(45)
a.forward(2*len)
a.circle(len,180)
#画圆(半径,旋转角度) 180度表示半圆
a.right(90)
a.circle(len,180)
a.forward(2*len)
a.hideturtle()#隐藏画笔
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