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

Administrator / level3-lesson15-diy1

  • 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
Commit cb266e49 authored 2 years ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

auto save

parent 385a72e3 c54006l1528p256a14963/T904511
Show whitespace changes
Inline Side-by-side
Showing with 18 additions and 7 deletions
  • my_tree.py
my_tree.py
View file @ cb266e49
import turtle import turtle
def tree(n): def tree(n):
if :
pen.forward(n)
pen.penup()
pen.backward(n)
pen.pendown()
pen = turtle.Turtle() pen = turtle.Turtle()
pen.color('sienna') pen.color('sienna')
# 画布大小 # 画布大小
...@@ -20,6 +16,21 @@ pen.backward(150) # 后退 ...@@ -20,6 +16,21 @@ pen.backward(150) # 后退
pen.down() pen.down()
tree(100) tree(100)
# pen.forward(100)
# pen.right(30)
# pen.forward(50)
# pen.penup()
# pen.forward(-50)
# pen.pendown()
# pen.left(60)
# pen.forward(50)
# pen.penup()
# pen.forward(-50)
# pen.pendown()
# pen.right(30)
# pen.penup()
# pen.forward(-100)
# pen.pendown()
# pen.hideturtle()
pen.hideturtle()
turtle.done() turtle.done()
This diff is collapsed. Click to expand it.
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment