Python绘制奥运五环


import turtle as t
def pic(color,x,y,r):
    t.width(10)
    t.color(color)
    t.penup()
    t.goto(x,y)
    t.pendown()
    t.circle(r)
    t.hideturtle()
if __name__ == "__main__":
    pic("blue",-180,0,50)
    pic("black",-60,0,50)
    pic("red",60,0,50)
    pic("yellow",-120,-50,50)
    pic("green",0,-50,50)
    t.penup()
    t.goto(-90,-80)
    t.pendown()
    t.color("red")
    t.write("奥运五环")
    t.done()

效果图:

在这里插入图片描述


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM