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

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

同切圆

>>> import turtle

>>> turtle.circle(50)
>>> turtle.circle(70)

同心圆

import turtle

>>> turtle.circle(100)

>>> turtle.up()
>>> turtle.goto(0,-100)
>>> turtle.down()
>>> turtle.circle(200)

五角星

import turtle

>>> turtle.forward(90)

>>> turtle.right(144)
>>> turtle.forward(90)
>>> turtle.right(144)
>>> turtle.forward(90)
>>> turtle.right(144)
>>> turtle.forward(90)
>>> turtle.right(144)
>>> turtle.forward(90)

 黄色的五角星

import turtle

turtle.color('yellow')
turtle.begin_fill()
turtle.fillcolor('yellow')
turtle.forward(90)
turtle.right(144)
turtle.forward(90)
turtle.right(144)
turtle.forward(90)
turtle.right(144)
turtle.forward(90)
turtle.right(144)
turtle.forward(90)

turtle.end_fill()

转载于:https://www.cnblogs.com/qianshu/p/7493110.html

你可能感兴趣的文章
mongod.service: control process exited, code=exited status=1
查看>>
c# 发送邮件、附件 分类: C# 2014-12-...
查看>>
对360来说,江湖上再无“搜狗”这个传说
查看>>
composer
查看>>
OpenCV特征点检测——ORB特征
查看>>
mysql的csv数据导入与导出
查看>>
leetcode笔记:Pascal's Triangle
查看>>
ASP.NET性能优化之构建自定义文件缓存
查看>>
Shell——windows上写完放入linux的时候需要注意的问题
查看>>
65条常用的正则表达式
查看>>
Vscode断点调试PHP
查看>>
做前端要做的6大事
查看>>
LeetCode 813. Largest Sum of Averages
查看>>
vSphere、Hyper-V与XenServer 你选哪个?
查看>>
java.lang.UnsupportedClassVersionError
查看>>
实现接口必须要加注解@Override吗
查看>>
apicloud UISearchBar 使用方法
查看>>
【spring+websocket的使用】
查看>>
mongo二维数组操作
查看>>
localStorage之本地储存
查看>>