首页 > 其他 > 详细

第一次作业

时间:2018-03-22 18:59:05      阅读:73      评论:0      收藏:0      [点我收藏+]

标签:IT   cli   pytho   setup   pre   let   range   ole   don   

import turtle as t
t.setup(600, 600, None,None)
t.pu()
t.fd(-120)
t.pensize(5)
t.width(5)
t.pencolor("darkgreen")
t.pd()
t.fd(250)
t.seth(120)
t.pencolor("black")
t.fd(250)
t.seth(-120)
t.pencolor("blue")
t.fd(250)
t.pencolor("purple")
t.fd(250)
t.seth(0)
t.pencolor("green")
t.fd(250)
t.pencolor("gold")
t.fd(250)
t.seth(120)
t.pencolor("red")
t.fd(250)
t.seth(-120)
t.pencolor("grey")
t.fd(250)
t.seth(120)
t.pencolor("violet")
t.fd(250)

 

import turtle
from turtle import done
 
t = turtle.Pen()
turtle.bgcolor("black")
t.pencolor("white")
i=0
while i<=5:
    t.forward(100)
    t.left(60)
    i=i+1
 
done()

 

import turtle  
  
turtle.left(30)  
turtle.forward(144)  
  
turtle.right(60)  
turtle.forward(144)  
  
turtle.right(60)  
turtle.forward(144)  
  
turtle.right(60)  
turtle.forward(144)  
  
turtle.right(60)  
turtle.forward(144)  
  
turtle.right(60)  
turtle.forward(144)  
  
turtle.forward(144)  
turtle.right(120)  
turtle.forward(144)  
  
turtle.left(60)  
turtle.forward(144)  
turtle.right(120)  
turtle.forward(144)  
  
turtle.left(60)  
turtle.forward(144)  
turtle.right(120)  
turtle.forward(144)  
  
turtle.left(60)  
turtle.forward(144)  
turtle.right(120)  
turtle.forward(144)  
  
turtle.left(60)  
turtle.forward(144)  
turtle.right(120)  
turtle.forward(144)  
  
turtle.left(60)  
turtle.forward(144)  
turtle.right(120)  
turtle.forward(144)  
  
turtle.exitonclick()  

 

 

import turtle 

def drawSnake(rad,angle,len,neckrad):
    for i in range (len):
        turtle.circle(rad,angle)
        turtle.circle(-rad,angle)
    turtle.circle(rad,angle/2)
    turtle.fd(rad)
    turtle.circle(neckrad+1,180)
    turtle.fd(rad*2/3)
def main():
    turtle.setup(1300,800,0,0)
    pythonsize = 30
    turtle.pensize(pythonsize)
    turtle.pencolor("blue")
    turtle.seth(-40)
    drawSnake(40,80,5,pythonsize/2)

main()

 

第一次作业

标签:IT   cli   pytho   setup   pre   let   range   ole   don   

原文:https://www.cnblogs.com/quanyitian-199810310032/p/8625367.html

(0)
(0)
   
举报
评论 一句话评论(0
0条  
登录后才能评论!
© 2014 bubuko.com 版权所有 鲁ICP备09046678号-4
打开技术之扣,分享程序人生!
             

鲁公网安备 37021202000002号