Home Article Practice python代码

python代码

2022-04-10 15:31  views:755  source:guowenjia0305    

import turtle turtle库
t = turtle.Turtle()-->t. turtle库(简便)
turtle.pensize() 设置画笔粗细;
turtle.pencolor() 设置画笔颜色;
turtle.speed() 设置画笔速度;
turtle.shape() 设置画笔造型;
turtle.forward() 往前移动长度;
turtle.backward() 往后移动长度;
turtle.right() 往右转动度数;
turtle.left() 往左转动度数;
turtle.pendown() 落笔;
turtle.penup() 抬笔;
turtle.goto(x,y) 移到x,y坐标;
turtle.exitonclick() 点击退出;
turtle.setheading() 面向方向
turtle.end_fill() 结束填色
turtle.begin_fill() 开始填色
turtle.colormode(255) 设置为RGB色彩模式
turtle.fillcolor(0,0,0) 设置RGB填充色
turtle.dot(30,"black") 绘制圆点(半径,颜色)
turtle.fillcolor() 填色颜色
turtle.bgcolor() 背景色
turtle.hideturtle() 隐藏小乌龟图形
turtle.circle() 画圆
print() 输出;
input() 输入;
for i in range(): 次数循环;
while : 条件循环;
if : 判断;
elif : 判断(带else);
else : 否则;
= 赋值;
== 等于;
> 大于;
< 小于;
red 红色
orange 橙色
brown 棕色
beige 米色
yellow 黄色
purple 紫色
gold 金色
snow 雪色
blue 蓝色
grey 灰色
silver 银色
violet 紫罗兰色
green 绿色
black 黑色
khaki 卡其色
coral 珊瑚色



Disclaimer: The above articles are added by users themselves and are only for typing and communication purposes. They do not represent the views of this website, and this website does not assume any legal responsibility. This statement is hereby made! If there is any infringement of your rights, please contact us promptly to delete it.

字符:    改为:
去打字就可以设置个性皮肤啦!(O ^ ~ ^ O)