博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
turtle库基础练习
阅读量:5328 次
发布时间:2019-06-14

本文共 2493 字,大约阅读时间需要 8 分钟。

画一组同切圆

import turtle

turtle.circle(50)
turtle.circle(60)
turtle.circle(70)
turtle.circle(80)

画一组同心圆

import turtle

turtle.circle(60)
turtle.up()
turtle.goto(65,0)
turtle.goto(0,0)
turtle.goto(-10,0)
turtle.goto(0,0)
turtle.goto(0,-20)
turtle.down()
turtle.circle(80)
turtle.up()
turtle.goto(0,-40)
turtle.down()
turtle.circle(100)

画一个五角星

import turtle

turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)

画一个黄色实心五角星

import turtle

turtle.bgcolor('red')
turtle.color('yellow')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)

turtle.end_fill()

红旗

import turtle

turtle.bgcolor('red')
turtle.up()
turtle.goto(-250,200)
turtle.down()
turtle.color('yellow')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.end_fill()
turtle.color('yellow')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.up()
turtle.goto(-150,250)
turtle.left(30)
turtle.down()
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.end_fill()
turtle.color('yellow')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.up()
turtle.goto(-130,220)
turtle.left(60)
turtle.down()
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.end_fill()
turtle.color('yellow')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.up()
turtle.goto(-110,170)
turtle.left(60)
turtle.down()
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.end_fill()
turtle.color('yellow')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.up()
turtle.goto(-160,108)
turtle.left(80)
turtle.down()
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.end_fill()

转载于:https://www.cnblogs.com/pys965085265/p/7493142.html

你可能感兴趣的文章
c++11 多线程依次打印ABC
查看>>
c#的const可以用于引用类型吗
查看>>
手动实现二值化
查看>>
What Linux bind mounts are really doing
查看>>
linux top命令详解
查看>>
博弈论小结
查看>>
模拟Post登陆带验证码的网站
查看>>
预科阶段:快速实战入门
查看>>
CentOS下安装配置MySQL8.0的步骤详解
查看>>
NYOJ458 - 小光棍数
查看>>
java中常用方法
查看>>
【Programming Clip】06、07年清华计算机考研上机试题解答(个别测试用例无法通过)...
查看>>
HTML基础
查看>>
老罗将死,或者Android也将就换代,但是互联网的,共享,互助精神将永存
查看>>
canvas动画
查看>>
系统软件构成
查看>>
4,7周围玩家
查看>>
关于webpack升级过后不能打包的问题;
查看>>
vue - 生命周期
查看>>
追忆我的2008-养成做笔记的习惯
查看>>