1.使用turtle库绘制红色五角星图形

import turtle
n = eval(input("请输入五角星的长度"))
turtle.begin_fill() #开始填充颜色
i = 0
while i < 5:
turtle.forward(n)
turtle.right(180-36)
i += 1
turtle.color("red") # 退出填充颜色
turtle.end_fill()
turtle.done()

  

2.使用turtle库绘制六角形图形

from turtle import *
color("black","red") begin_fill()
pu()
fd(-200)
pd()
seth(30)
fd(300)
seth(-90)
fd(300)
seth(150)
fd(300)
end_fill() pu()
seth(90)
fd(150)
seth(0)
fd(87)
begin_fill() pd()
seth(-90)
fd(300)
seth(30)
fd(300)
seth(150)
fd(300)
end_fill()
done()

  

3.使用turtle库绘制叠加等边三角形图形

import turtle as t
t.setup(600, 600, None,None)
t.pu()
t.fd(-120)
t.pensize(5)
t.width(5)
t.pencolor("darkgreen")
t.pd()
t.fd(250)
t.seth(120)
t.pencolor("black")
t.fd(250)
t.seth(-120)
t.pencolor("blue")
t.fd(250)
t.pencolor("purple")
t.fd(250)
t.seth(0)
t.pencolor("green")
t.fd(250)
t.pencolor("gold")
t.fd(250)
t.seth(120)
t.pencolor("yellow")
t.fd(250)
t.seth(-120)
t.pencolor("grey")
t.fd(250)
t.seth(120)
t.pencolor("pink")
t.fd(250)

  

最新文章

  1. ASP.NET MVC5+EF6+EasyUI 后台管理系统(43)-工作流设计-字段分类设计
  2. 文件夹右键添加“DOS”命令
  3. 【python】装饰器
  4. 转:AngularJS的Filter用法详解
  5. SQL入门经典(八) 之存储过程
  6. Python之with语句
  7. Recovery和Charger模式下屏幕旋转180度
  8. 解决微信OAuth2.0网页授权回调域名只能设置一个的问题
  9. php日期时间函数 整理
  10. 使用Maven创建一个Spring MVC Web 项目
  11. UVa 11021 (概率 递推) Tribles
  12. POJ 3264 Balanced Lineup(RMQ)
  13. MAC OS X 快捷键(自己总结)
  14. DIV+CSS初学随记
  15. JAVA写接口傻瓜(?)教程(一)
  16. LeetCode算法题-Implement Queue Using Stacks(Java实现)
  17. Mysql数据库表被锁定处理
  18. nobup 与 后台运行命令
  19. [java]转:String Date Calendar之间的转换
  20. [python] os.path模块常用方法汇总

热门文章

  1. python学习之变量以及变量/标识符/关键字
  2. .Net Core WPF之XAML概述
  3. LFU C# 实现
  4. java web程序员微信群
  5. [hdu4416 Good Article Good sentence]后缀自动机SAM
  6. [hdu4585]离线,并查集
  7. 【蓝桥杯C组】备赛基础篇之高精度算法
  8. 初识spring boot maven管理--配置文件
  9. Spring全家桶之springMVC(四)
  10. String,StringBuffer,StringBuilder三者的区别