Commit 8ac9efc4 by BellCodeEditor

auto save

parent 69d18600
Showing with 20 additions and 17 deletions
import turtle
#创建画布
#设置画布颜色
screen=turtle.Screen()#创建画布
screen.bgcolor("yellow")#设置画布颜色
pen=turtle.Pen()
#抬笔
#画笔移到50,-100
pen.penup()#抬笔
pen.goto(50,-100)#画笔移到50,-100
pen.write("你好呀",font=("Times",20,"normal"))
turtle.done() #删掉这行
#创建新画笔pen1
#设置画笔大小
#设置画笔颜色
#绘制爱心
#左转45°
#移动100步
#画一个半径为50的半圆
#右转90°
#画一个半径为50的半圆
#移动100步
#保存画布
\ No newline at end of file
len=screen.textinput("提示","你想要画一个多大的爱心呀")
lovesize=int(len)#创建一个变量len,储存圆的半径
pen1=turtle.Pen()#创建新画笔pen1
pen1.pensize(10)#设置画笔大小
pen1.pencolor("red")#设置画笔颜色
pen1.left(45)#左转45°
pen1.forward(lovesize*2)#移动2*len步
pen1.circle(lovesize,180)#画一个半径为len的半圆
pen1.right(90)#右转90°
pen1.circle(lovesize,180)#画一个半径为len的半圆
pen1.forward(lovesize*2)#移动2*len步
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