python疊加等邊三角形繪制


import turtle 
turtle .pu()
turtle .fd(-120)
turtle.pensize(3)
turtle.width(5)
turtle.pencolor("green")
turtle.pd()
turtle.fd(250)
turtle.seth(120)
turtle.pencolor("green")
turtle.fd(250)
turtle.seth(-120)
turtle.pencolor("blue")
turtle.fd(250)
turtle.pencolor("blue")
turtle.fd(250)
turtle.seth(0)
turtle.pencolor("black")
turtle.fd(250)
turtle.pencolor("black")
turtle.fd(250)
turtle.seth(120)
turtle.pencolor("yellow")
turtle.fd(250)
turtle.seth(-120)
turtle.pencolor("yellow")
turtle.fd(250)
turtle.seth(120)
turtle.pencolor("purple")
turtle.fd(250)

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM