python怎么实现奥运五环

发布时间:2022-01-13 09:59:13 作者:iii
来源:亿速云 阅读:225

这篇文章主要介绍了python怎么实现奥运五环的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇python怎么实现奥运五环文章都会有所收获,下面我们一起来看看吧。

代码:


import turtle

turtle.showturtle()
turtle.penup()
turtle.goto(-30,240)
turtle.pendown()
turtle.color("red")
turtle.write("奥运五环",font=("宋体",25))

turtle.pensize(10)
turtle.penup()
turtle.goto(0,0)
turtle.pendown()
turtle.color("red")
turtle.circle(100)

turtle.penup()
turtle.goto(-200,0)
turtle.pendown()
turtle.color("green")
turtle.circle(100)

turtle.penup()
turtle.goto(200,0)
turtle.pendown()
turtle.color("blue")
turtle.circle(100)

turtle.penup()
turtle.goto(-100,-180)
turtle.pendown()
turtle.color("yellow")
turtle.circle(100)

turtle.penup()
turtle.goto(100,-180)
turtle.pendown()
turtle.color("purple")
turtle.circle(100)

# turtle.clear() #清除屏幕内容
turtle.done() 

效果图:

python怎么实现奥运五环

关于“python怎么实现奥运五环”这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对“python怎么实现奥运五环”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注亿速云行业资讯频道。

推荐阅读:
  1. php趣味 - php 奥运五环
  2. 如何使用 canvas绘制奥运五环

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

python

上一篇:redis中多样的数据类型及集群相关的知识有哪些

下一篇:python编码和解码是什么

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》