Skip to content

Functions¶

About This Lesson¶

Learn to write reusable code with Python functions. Master function definition, parameters, return values, and advanced function concepts.

What You'll Learn¶

  • Defining functions with def
  • Function parameters and arguments
  • Return values
  • Default parameters
  • args and *kwargs
  • Lambda functions
  • Function scope
  • Docstrings
  • Use the MkDocs navigation on the left to move between lessons
  • The notebook below is fully interactive - you can run and edit code
  • Your changes are saved in your browser's local storage

Interactive Notebook¶


Having trouble with the embedded notebook? Try one of these: