python画奥运五环
#绘制奥运五环,一步一步来,然后每一步根据坐标计算【做什么都要先打骨架,如这里先画出五个关键的圆,再去对其进行颜色、何时抬笔、何时落笔的优化,最后才是宽度粗细的把握】
import turtle
turtle.showturtle()
turtle.width(5)
turtle.color('DeepSkyBlue')
turtle.circle(50)
turtle.penup()
turtle.goto(120,0)
turtle.pendown()
turtle.color('black')
turtle.circle(50)
turtle.penup()
turtle.goto(240,0)
turtle.pendown()
turtle.color('red')
turtle.circle(50)
turtle.penup()
turtle.goto(60,-50)
turtle.pendown()
turtle.color('yellow')
turtle.circle(50)
turtle.penup()
turtle.goto(180,-50)
turtle.pendown()
turtle.color('green')
turtle.circle(50)
turtle.penup()
turtle.goto(-300,300)
结果: