Commit f5a90ba5 by BellCodeEditor

auto save

parent c2f1308f
Showing with 68 additions and 2 deletions
1. pen.write(文字内容,字体参数)
2.文字内容是一个字符串
3.字体参数时一个元组 包含3个小的参数 字体名称(str) 字体大小(int) 字体类型(str)
4.元组和列表很相似,列表使用中括号, 元组使用小括号
5. \n 转义字符 换行 需要放到引号里边
6.pen.circle(半径,夹角)
7.直径 = 2*半径
8.画笔粗细: pen.pensize()
9.画笔颜色: pen.pencolor()
10.抬笔: pen.penup()
11.落笔: pen.pendown()
12.移动坐标: pen.goto(x,y)
13.创建画布: screen = turtle.Screen()
14.设置背景颜色: screen.bgcolor("颜色")
15.screen.textinput(标题,问题)
标题和问题都是字符串类型
16.数据类型转换函数
int() 将整数的字符串或者是小数 转换为整数
float() 将整数转换为小数 或者是将字符串转换为小数 但必须是数字的形式
str() 将目标转换为字符串
\ No newline at end of file
a = '[123,13]'
b = str(a)
print(b)
print(type(b))
\ No newline at end of file
# 利用write()帮助悟空给诺依回信吧~ # 利用write()帮助悟空给诺依回信吧~
\ No newline at end of file #1.导入
import turtle
2.创建画笔
pen = turtle.Pen()
#3.使用write函数来写一段文字
#4.隐藏画笔形状
pen.hideturtle()
#5.保留画布
#画爱心
pen1 = turtle.Pen()
#0.设置粗细和颜色
#1.左转45
#2.移动100
#3.画半圆 半径为50 夹角180
#4.右转90
#5.画半圆 半径为50 夹角180
#6.移动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