永发信息网

python 彩色蟒蛇

答案:1  悬赏:50  手机版
解决时间 2021-02-14 01:10
  • 提问者网友:一抹荒凉废墟
  • 2021-02-13 10:15
python 彩色蟒蛇
最佳答案
  • 五星知识达人网友:英雄的欲望
  • 2021-02-13 10:51
def drawSnake(rad,angle,len,neckrad):
        mycolor=["black","red","red","blue","yellow"]
        yocolor=["yellow","green","yellow","red","red"]
        for i in range(len):
            turtle.pencolor(mycolor[i])
            turtle.circle(rad,angle)
            turtle.pencolor(yocolor[i])
            turtle.circle(-rad,angle)
        turtle.pencolor("green")
        turtle.circle(rad,angle/2)
        turtle.pencolor("yellow")
        turtle.fd(rad)
        turtle.pencolor("red")
        turtle.circle(neckrad+1,180)
        turtle.pencolor("green")
        turtle.fd(rad*2/3)


















def main():
       turtle.setup(1300,800,0,0)
       pythonsize=30
       turtle.pensize(pythonsize)
       turtle.seth(-40)

       drawSnake(40,80,5,pythonsize/2)
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯