• 博客园logo
  • 会员
  • 周边
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
HBUwyf
博客园    首页    新随笔    联系   管理    订阅  订阅
第一次作业


#叠加等边三角形绘制。(教材第二章程序练习题 2.5  ,第56页)
import
turtle turtle.penup() turtle.pendown() turtle.pensize(30) turtle.pencolor("blue") turtle.fd(300) turtle.seth(-120) turtle.fd(300) turtle.seth(120) turtle.fd(300) turtle.seth(60) turtle.fd(300) turtle.seth(-60) turtle.fd(600) turtle.seth(180) turtle.fd(600) turtle.seth(60) turtle.fd(300) #正方形螺旋线的绘制。(教材第二章程序练习题 2.8 ,第56-57页) import turtle turtle.setup(650,350,200,200) turtle.up() turtle.down() turtle.color("blue") x = -20 y = -20 z = (20,25,30,35,40,45,50,55,60,65,70,75,80,85,90) turtle.pensize(5) for i in range(15): turtle.fd(z[i]) turtle.right(90) turtle.done()

#python 蟒蛇的绘制  

 

import turtle
turtle.setup(650,350,200,200)
turtle.up()
turtle.down()
turtle.color("blue")
x = -20
y = -20
z = (20,50,80,110,140,170,200,230,260,290,320,350)
turtle.pensize(20)
for i in range(12):
    turtle.circle(z[i],180)
    
turtle.pensize(50)
turtle.fd(50)

turtle.penup()
turtle.goto(-10,-350)
turtle.pendown()
turtle.begin_fill()
turtle.pensize(4)
turtle.fillcolor("white")
turtle.pencolor("white")
turtle.circle(4,360)
turtle.end_fill()

turtle.penup()
turtle.goto(60,-350)
turtle.pendown()
turtle.begin_fill()
turtle.pensize(4)
turtle.fillcolor("white")
turtle.pencolor("white")
turtle.circle(4,360)
turtle.end_fill()

 

 

 

 

 

posted on 2018-03-28 19:14  hbuwyf  阅读(177)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3