这里选择的是一条小鱼(简笔画)
先放一下效果

思路是先把背景调成蓝色,然后画一个橙色的圆和一个橙色的三角形当小鱼的头和尾巴,然后画一个黑色的圆当小鱼的眼睛
代码如下:
import turtle
import math
screen = turtle.Screen()
screen.bgcolor("blue")
turtle.pensize(3)
turtle.colormode(255)
turtle.pencolor("orange")
turtle.fillcolor("orange")
turtle.begin_fill()
turtle.penup()
turtle.goto(0, 0)
turtle.pendown()
turtle.circle(50)
turtle.end_fill()
turtle.penup()
turtle.goto(50, 50)
turtle.right(45)
turtle.pendown()
turtle.begin_fill()
turtle.forward(40)
turtle.left(135)
turtle.forward(math.sqrt(3200))
turtle.left(135)
turtle.forward(40)
turtle.end_fill()
turtle.penup()
turtle.goto(-30, 50)
turtle.pencolor("black")
turtle.fillcolor("black")
turtle.begin_fill()
turtle.circle(10)
turtle.end_fill()
turtle.penup()
turtle.hideturtle()
turtle.done()

被折叠的 条评论
为什么被折叠?



