首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >潘石屹用Python解决100个问题 | 奥运五环

潘石屹用Python解决100个问题 | 奥运五环

作者头像
week
发布2020-07-06 17:46:19
发布2020-07-06 17:46:19
4580
举报
文章被收录于专栏:用户画像用户画像

使用Python画奥运五环

1、效果图

2、代码

代码语言:javascript
复制
import turtle
import time
myPen=turtle.Pen()
myPen.speed(0)
myPen.pensize(5)
circle_pos=[(0,0),(100,0),(50,-55),(-50,-55),(-100,0)]
colors=["black","red","green","yellow","blue"]
continent_name=["非洲","美洲","大洋洲","亚洲","欧洲"]
continent_pos=[(0,0+50),(100,0+50),(50,-55+50),(-50,-55+50),(-100,0+50)]
for i in range(5):
    myPen.penup()
    myPen.goto(circle_pos[i])
    myPen.pendown()
    myPen.pencolor(colors[i])
    myPen.circle(50)
    myPen.penup()
    myPen.goto(continent_pos[i])
    myPen.pendown()
    myPen.write(continent_name[i],font=("Arical",13))
time.sleep(60)
turtle.done
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020/07/06 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档