< Back

Post Lab 5

In this post-lab you will demonstrate your understanding of the turtle module by creating a simple drawing.

Details

Create a Python program that uses the turtle module to draw an equilateral triangle that is centered in the window. You can choose any size and orientation for the triangle, but the length of every side must be the same. In order to center the triangle you will need to calculate the height of the triangle. The height of the triangle can be calculated witht the following equation:

$$h = \frac{l \cdot \sqrt{3}}{2}$$

Where \(h\) is the height of the triangle and \(l\) is the length of a side of the triangle. The program should use variables and arithmetic expressions where appropriate and follow the course's code conventions.

Example

$ python3 triangle.py
Turtle Graphics Triangle

Submission

Submissions for post labs are to be done via the inquire system. Go to http://inquire.roanoke.edu/ You should see a section for post labs. Submit your .py file to the appropriate post lab location.