Python Foundations · Unit 3

Unit 3: Functions

Write reusable functions with parameters, return values and scope.

  • 2–3 hrs
  • Beginner
  • 10 lessons

Lessons

  1. What Are FunctionsWhat functions are, why functions are useful, when to use functions, built-in functions 15–20 min
  2. Defining and Calling FunctionsHow to define functions, function syntax, how to call functions, function naming 15–20 min
  3. Parameters and ArgumentsWhat parameters are, what arguments are, the difference, multiple parameters 20–25 min
  4. Return StatementsWhat return does, using return values, return vs print, functions without return 20–25 min
  5. Variable Scope & LifetimeLocal vs global variables, variable scope, variable lifetime, best practices 20–25 min
  6. Default & Optional ParametersDefault parameter values, optional parameters, calling with defaults, best practices 15–20 min
  7. Docstrings & DocumentationWhat docstrings are, writing docstrings, accessing docstrings, best practices 15–20 min
  8. Nested & Helper FunctionsNested functions, helper functions, scope in nested functions, when to use them 20–25 min
  9. Lambda FunctionsWhat lambda functions are, lambda syntax, using lambdas, lambda vs regular functions 20–25 min
  10. Practical Function ExamplesCombining concepts, real-world applications, code organization, best practices 30–40 min
  11. End of unit test

    Ten multiple choice questions worth 7 points each and one free response problem worth 30, so 100 in total. Score 70 or more to finish Unit 3 and unlock Unit 4.

    Take the Unit 3 test