Commit f95d1150 by BellCodeEditor

auto save

parent a50ceeec
Showing with 30 additions and 0 deletions
import turtle#加载turtle功能
screen=turtle.Screen() #将turtle中的Screen()函数放入screen变量
screen.bgcolor("pink") #背景颜色设置为"pink"(粉色)
pen=turtle.Pen() #将turtle中的Pen()函数放入pen变量
pen.write("离离原上草\n一岁一枯荣",font=("Times",15,"normal"))
#输入内容,需要换行时使用\n功能,标准字体“Times”,大小15,类型
#“normal”
pen.hideturtle( )#隐藏画笔pen
pen1=turtle.Pen() #将turtle中的Pen()函数放入pen1变量
pen1.penup() #抬笔
pen1.goto(-100,0) #移动到(-100,0)的位置
pen1.pencolor("red") #画笔颜色红色“red”
pen1.pensize(5) #画笔粗细5
pen1.pendown() #落笔
len=50
pen1.left(45) #左转45°
pen1.forward(2*len) #前进100
pen1.circle(len,180) #画一个半径50的圆,画180的范围
pen1.right(90) #右转90
pen1.circle(len,180) #画一个半径50的圆,画180的范围
pen1.forward(2*len) #前进100
pen1.hideturtle() #隐藏画笔pen1
turtle.done() #结束绘画但不关闭画布
\ No newline at end of file
import turtle
screen=turtle.Screen()
screen.textinput("姓名框","你的名字是:")
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