From 7883637d8bf853a31c2720aa9ce99c20bcd3d36f Mon Sep 17 00:00:00 2001 From: njmason2 Date: Sun, 31 Aug 2025 10:25:09 -0400 Subject: [PATCH] shapes.py In a computer program a function can be used many times, just like a variable, with different input values and different output values possible. In modular programmimg and object-oriented programming, hundreds or even thousands of functions can be "called" by a main program, such as a large program that calculates your Federal IRS 1040 Income Tax each year. The program has to be updated each year for changes in the current year tax laws. --- shapes.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/shapes.py b/shapes.py index 731ec39..b50251c 100644 --- a/shapes.py +++ b/shapes.py @@ -5,7 +5,19 @@ from turtle import * def triangle(side_length): - pass - + forward(side_length) + right(120) + forward(side_length) + right(120) + forward(side_length) + right(120) + def rectangle(height, width): - pass + forward(width) + right(90) + forward(height) + right(90) + forward(width) + right(90) + forward(height) + right(90)