python中画奥运五环的方法-创新互联

创新互联www.cdcxhl.cn八线动态BGP香港云服务器提供商,新人活动买多久送多久,划算不套路!

张家界网站建设公司成都创新互联,张家界网站设计制作,有大型网站制作公司丰富经验。已为张家界上千余家提供企业网站建设服务。企业网站搭建\成都外贸网站建设要多少钱,请找那个售后服务好的张家界做网站的公司定做!

这篇文章给大家分享的是有关python中画奥运五环的方法的内容。小编觉得挺实用的,因此分享给大家做个参考。一起跟随小编过来看看吧。

绘制奥运五环主要涉及到Python中的turtle绘图库运用:

python中画奥运五环的方法

程序源代码为:

import turtle
turtle.width(10)
turtle.color('black')
turtle.circle(50)
turtle.penup()
turtle.goto(120,0)
turtle.pendown()
turtle.color('red')
turtle.circle(50)
turtle.penup()
turtle.goto(240,0)
turtle.pendown()
turtle.color('blue')
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('pink')
turtle.circle(50)
#Python绘制奥运五环

运行后,结果为:

python中画奥运五环的方法

感谢各位的阅读!关于python中画奥运五环的方法就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到吧!


标题名称:python中画奥运五环的方法-创新互联
当前路径:http://myzitong.com/article/dsisce.html