Commit 2a16472e by BellCodeEditor

auto save

parent f40d896f
Showing with 18 additions and 6 deletions
import turtle # 导入turtle模块 import turtle # 导入turtle模块
# 写字 # 写字
pen=turtle.Pen() # 创建画笔,调用turtle模块.Pen方法首字母大写 # pen=turtle.Pen() # 创建画笔,调用turtle模块.Pen方法首字母大写
# 用write()方法将内容写子啊画布上,参1书写内容(\n换行)参2字体名称大小类型赋值给font(元组) # 用write()方法将内容写在画布上,参1书写内容(\n换行)参2字体名称大小类型赋值给font(元组)
pen.write("诺依,\nturtle真好用,\n我会在画布上写字了",font=("Times",30,"normal")) # pen.write("诺依,\nturtle真好用,\n我会在画布上写字了",font=("Times",30,"normal"))
pen.hideturtle() # 调用hideturtle()方法隐藏画笔 # pen.hideturtle() # 调用hideturtle()方法隐藏画笔
turtle.done() # 保存画布 # turtle.done() # 保存画布
\ No newline at end of file # 画爱心
pen1 = turtle.Pen() # 新建画笔Pen1
pen1.pencolor("red") # 设置线条的颜色
pen1.pensize(5) # 设置线条的粗细
pen1.left(45) # 左转45
pen1.forward(100) # 向前100
pen1.circle(50,180) # 画出半圆50,180
pen1.right(90) # 右转90
pen1.circle(50,180) # 画出半圆50,180
pen1.forward(100) # 向前100
pen1.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