CPSC120B
Fundamentals of Computer Science I

Post-lab 11

Functions

Details

In a Python file called triangles.py, create a function called draw_triangle(center_x, center_y), which uses the graphics module to draw a fixed sized equilateral triangle centered at the specified x/y coordinates. You can compute the height of an equilateral triangle using the equation:

\[ h = \frac{\sqrt{3}}{2} \times side\_length \]

Where side_length is the length of each side of the triangle

  draw_triangle(320, 240)

Submission

Submit your code on the course Inquire site.