The correct answer is All of the above.
Functions in Karel programs (as well as in programming in general) serve several important purposes:
-
Break down our program into smaller parts: Functions allow you to decompose complex problems into more manageable sub-problems, which can be tackled individually.
-
Avoid repeating code: By using functions, you can define code once and call it multiple times, promoting reusability and reducing redundancy.
-
Make our program more readable: Functions help to organize code and create a clearer structure, making it easier for others (and yourself) to understand what the code does.
Overall, using functions leads to better code organization and maintenance.