Organizing Code
With data types, variables, lists, loops, and functions, you have the tools to build more complicated programs. As you've seen by now, there are lots of ways to solve any given programming problem. So... what makes a good solution?
The next few lessons will cover more function syntax. They'll also focus on how to use functions to organize your code, and how to use documentation and naming to make your program easier to understand -- both for others and for yourself.
Learning Objectives
After this week, you will be able to:
- Use helper functions to split problems into smaller pieces
- Use default arguments, keyword arguments, and
*args
to make your functions more flexible - Document your functions so that other programmers (or you at another time) can better understand how your code works