其他分享
首页 > 其他分享> > 5_奥运五环

5_奥运五环

作者:互联网

import turtle
coordA=(-100,0,100,-50,50)
coordB=(-20,-20,-20,-70,-70)
turtle.width(5)
turtle.color("red")
turtle.penup()
turtle.goto(coordA[0],coordB[0])
turtle.pendown()
turtle.circle(45)
turtle.color("blue")
turtle.penup()
turtle.goto(coordA[1],coordB[1])
turtle.pendown()
turtle.circle(45)
turtle.color("green")
turtle.penup()
turtle.goto(coordA[2],coordB[2])
turtle.pendown()
turtle.circle(45)
turtle.color("yellow")
turtle.penup()
turtle.goto(coordA[3],coordB[3])
turtle.pendown()
turtle.circle(45)
turtle.color("black")
turtle.penup()
turtle.goto(coordA[4],coordB[4])
turtle.pendown()
turtle.circle(45)
turtle.hideturtle()
turtle.done()

 

 

 

 

标签:turtle,coordB,penup,color,五环,pendown,奥运,goto
来源: https://www.cnblogs.com/666-/p/15404319.html