Skip to content

Latest commit

 

History

History
61 lines (50 loc) · 1.62 KB

File metadata and controls

61 lines (50 loc) · 1.62 KB

Week 7 – Student Tasks: Turtle Art Gallery

Task A: Run the program

  1. Open week07.py in Thonny
  2. Press Run (F5)
  3. Observe: You should see 3 squares appear in different positions

Task B: Make modifications

Try these changes one at a time:

  1. Change square sizes

    • Find the line: draw_square(60)
    • Change 60 to 100 and run
    • Try different sizes for each square
  2. Move squares to new positions

    • Find: t.goto(120, 0)
    • Change to: t.goto(200, 100)
    • Experiment with different X and Y values
  3. Change turtle speed

    • Find: t.speed(6)
    • Try: t.speed(1) (very slow) or t.speed(10) (fast)
    • Try: t.speed(0) (instant - no animation)
  4. Add a fourth square

    • Copy these lines after the third square:
    t.penup(); t.goto(-200, -100); t.pendown()
    draw_square(75)

Task C: Creative challenges

  1. Draw a triangle

    • Create a new function called draw_triangle(size)
    • A triangle has 3 sides
    • Each turn should be 120 degrees (360 ÷ 3)
    • Hint:
    def draw_triangle(size):
        for _ in range(3):
            t.forward(size)
            t.right(120)
  2. Add colors

    • Before drawing a shape, add: t.color("blue")
    • Try different colors: "red", "green", "purple", "orange"
  3. Create a pattern

    • Draw 5 squares in a row
    • Make each one a different size
    • Bonus: Use different colors for each

Success checklist

  • Program runs without errors
  • I can change square sizes
  • I can move squares to different positions
  • I added at least one new shape
  • I understand what penup/pendown do