Functions in Python
Functions in Python

Functions in Python

Table of contents

  1. Types of Functions
  2. Creating a Function
    • Creating a function without any parameters
    • Creating a function with parameter s
    • Creating a function with parameters and return value
  3. Calling a function
    • Calling a function of a module
  4. Docstrings
    • Single-Line Docstring
    • Multi-Line Docstring
  5. Return Value From a Function
  6. Scope and Lifetime of Variable
  7. Global Keyword in Function
  8. Nonlocal Variable in Function
  9. Python Function Arguments
    • Positional Arguments
    • Keyword Arguments
    • Default Arguments
    • Variable-length Arguments
  10. Recursive Function

1. Types Of Function

2. Creating a Function

3. Calling a Function

4. Docstrings

5. Return Value From a Function

6. The pass Statement

7. Scope and Lifetime of Variables

8. Global Keyword in Python Functions

9. Nonlocal Variables in Python Functions

10. Python Function Arguments

11. Recursive Functions

12. Python Anonymous/Lambda Function