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.
This commit is contained in:
njmason2
2025-08-31 10:25:09 -04:00
parent d8c9ec1884
commit 7883637d8b

View File

@@ -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)