Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

bellcode / lesson10-4

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • lesson10-4
  • diy1.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    auto save · 15722eab
    BellCodeEditor committed a year ago
    15722eab
diy1.py 602 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# 悟空想海龟作图画出弹簧隧道,但是出现了bug,运行不了,请你帮助他,修改bug~
import turtle 
pen=turtle.Pen() # 画笔
screen=turtle.Screen() # 画布
pen.speed() # 画笔速度
pen.hideturtle() # 隐藏画笔
screen.bgcolor('black') # 背景颜色

i=0
while i<135:
    pen.pencolor('pink') # 画笔颜色
    pen.penup() # 抬笔
    pen.goto(0,0) 移动到(0,0)坐标处
    pen.forward(200) # 沿着当前方向前进指定距离
    pen.pendown()#落笔
    pen.circle(100) # 绘制一个半径100的圆
    pen.left(2)# 向左旋转2度
    i+=1
turtle.done()