python如何画奥运五环

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

程序源代码为:

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绘制奥运五环

运行后,结果为:

相关推荐

  1. 如何Python正方形

    2024-04-02 04:30:02       31 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-02 04:30:02       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-02 04:30:02       106 阅读
  3. 在Django里面运行非项目文件

    2024-04-02 04:30:02       87 阅读
  4. Python语言-面向对象

    2024-04-02 04:30:02       96 阅读

热门阅读

  1. MySql判断表是否被锁定、如何解锁

    2024-04-02 04:30:02       40 阅读
  2. 6.游戏。

    2024-04-02 04:30:02       37 阅读
  3. EXCEL VBA 计算财务报表透视图计算汇总透视表

    2024-04-02 04:30:02       37 阅读
  4. 【建议收藏】Tomcat 优化总结

    2024-04-02 04:30:02       39 阅读
  5. 2024.4.1exercise

    2024-04-02 04:30:02       35 阅读
  6. pytest中文使用文档----8捕获告警信息

    2024-04-02 04:30:02       34 阅读
  7. Vue中的MVVM

    2024-04-02 04:30:02       43 阅读
  8. C++经典面试题目(十八)

    2024-04-02 04:30:02       34 阅读