F. Drawing the ใฑ Shape
๐ฏ Learning Goals
By the end of this lesson, you'll be able to:
- โ Can combine straight lines and rotations
- โ Can draw the 'ใฑ' shape
- โ Understands that code order matters
โก 30-Second Challenge
Run the code below to see the 'ใฑ' shape!
Did it work? Let's learn more about it below!
Core Concepts
Analyzing the 'ใฑ' shape
'ใฑ' is made up of two lines:
| Order | Action | Result |
|---|---|---|
| 1๏ธโฃ | Move forward | Horizontal line |
| 2๏ธโฃ | Turn right 90 degrees | Change direction |
| 3๏ธโฃ | Move forward | Vertical line |
Order matters!
Watch the order!
If you rotate first, you get a different shape!
- Move โ turn โ move = ใฑ shape โ
- Rotate โ move โ move = ใ ฃ shape โ
Try Visual Coding
Mission
Try drawing the 'ใฑ' shape! (forward โ right 90 degrees โ forward)
# Add blocks and the Python code will show up here...
Add blocks and the flowchart will show up here...
Example Code
import turtle
t = turtle.Turtle()
t.shape("turtle")
t.forward(100) # Horizontal line
t.right(90) # Going downward
t.forward(100) # Vertical line
What Happens
The 'ใฑ' shape gets drawn!
Quiz
Quiz: the order for the 'ใฑ' shape
Which order is correct to draw the 'ใฑ' shape?
Show Answer
Answer: B) Move โ turn โ move
First draw the horizontal line, change direction, then draw the vertical line.
๐ง Debug Clinic
Problem: a different shape shows up instead of 'ใฑ'!
โ Wrong order
Cause: the rotation angle or direction is wrongโ Correct order
Fix:right(90)Use it, and check the order!
Try Coding It Yourself
Take what you learned with the blocks and write it yourself in Python code!
Drawing the ใฑ Shape
forward()and right()Draw the 'ใฑ' shape with it.
Example Answer
Result: The turtle draws the 'ใฑ' shape!
ใฑ Shape Practice
- Order: move โ Rotate โ move
- Rotation function:
t.right(90) - Number of lines: 2(horizontal + vertical)
Review Checklist
- [ ] You can describe the order for drawing the 'ใฑ' shape (move โ turn โ move)
- [ ] You know why you use right(90) for the 'ใฑ' shape
- [ ] You understand that changing the order of the code makes a different shape
๐งฉ Key Takeaways
What you learned in this lesson:
| Concept | Description |
|---|---|
| ใฑ Shape | Horizontal line + vertical line = 2 lines |
| Order | Move โ turn โ move |
| Rotate | right(90) Use |