Succi-turtle学习画画

更多内容可以联系少儿编程侯老师,微信data_ecology
本文链接: https://blog.csdn.net/houlaos/article/details/102756540
import turtle
# 画一条直线forward turtle
# 颜色color 粗细pensize 圆形circle
# 去goto
# 抬笔落笔up  down
# fill
turtle.shape('turtle')
turtle.color("blue","red") # 边的颜色,填充颜色
turtle.pensize(10)
turtle.speed(0) # 速度

turtle.begin_fill()
turtle.fd(100)
turtle.left(90)
turtle.fd(100)
turtle.left(90)
turtle.fd(100)
turtle.left(90)
turtle.fd(100)
turtle.left(90)
turtle.end_fill()
turtle.penup()  # 抬笔
turtle.goto(-100,100)  # 转换坐标
turtle.pendown()  # 落笔

# 画眼睛
turtle.color("black","blue")
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()
turtle.penup()  # 抬笔
turtle.goto(200,100)  # 转换坐标
turtle.pendown()  # 落笔
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()
turtle.done()

猜你喜欢

转载自blog.csdn.net/houlaos/article/details/102756540
今日推荐