From 6738b0110b4ff3968f77b7f0faffbcf7ec9a8303 Mon Sep 17 00:00:00 2001 From: kdang Date: Mon, 22 Sep 2025 09:30:00 -0400 Subject: [PATCH] A value is anything that it is what it is, but a name refers to something else. For example. your name refers to you, but you are not the same as your name, being able to change your name and staying as the same person. Variables could be useful in programming when you have to write a lot of code for a specific thing. A function is like a variable, as it assigns a name to a block of code, like how a variable is a name that refers to a value. Functions can be useful when you have to run a specific code block a lot, like when you have to draw a triangle 5 times. Instead of writing the code block 5 times, you can define a function with the triangle code block and you will only have to write the code block once, and will only have to write the function 4 more times. --- shapes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/shapes.py b/shapes.py index 9d88ec2..5df6302 100644 --- a/shapes.py +++ b/shapes.py @@ -12,6 +12,7 @@ def triangle(side_length): forward(side_length) right(120) + def rectangle(height, width): forward(height) right(90)