Learn basic Python functions, loops, and Turtle graphics by drawing a simple house.
You must complete the following functions in main.py:
- draw_square(t, side)
- draw_triangle(t, side)
- draw_house(t)
A simple house consisting of:
- A square (base)
- A triangle (roof)
- Do NOT rename the functions.
- Do NOT remove the function definitions.
- Use loops (for loop recommended).
- Use correct angles:
- Square β 90 degrees
- Triangle β 120 degrees
- Call
turtle.done()only at the end of the program.
| Component | Marks |
|---|---|
| Function definitions | 20 |
| Square logic correct | 30 |
| Triangle logic correct | 30 |
| House structure | 20 |
Total: 100 Marks
python main.py- A square has 4 sides and turns 90 degrees.
- An equilateral triangle has 3 sides and turns 120 degrees.