🌍 Python Programming · subject

Python Programming Functions and Functional Programming Syllabus

Every chapter and topic of Functions and Functional Programming examined in Python Programming — 5 chapters, 16 topics, plus 50 flashcards written against it.

5Chapters
16Topics
0Sub-topics
~10hEst. first pass
13%Of Python Programming
50Flashcards

Functions and Functional Programming syllabus — full chapter and topic list

Expand any chapter to see its topics and sub-topics. This is the whole examinable outline for Functions and Functional Programming in Python Programming, not a summary of it.

  1. Defining Functions

    3 topics
    • Function Syntax and return
    • Parameters and Arguments
    • Docstrings
  2. Scope and Namespaces

    3 topics
    • Local and Global Scope
    • The global and nonlocal Keywords
    • LEGB Rule
  3. Lambda and Higher-Order Functions

    3 topics
    • Lambda Expressions
    • map(), filter() and reduce()
    • Functions as First-Class Objects
  4. Iterators and Generators

    3 topics
    • The Iterator Protocol
    • Generator Functions and yield
    • Generator Expressions
  5. Closures and Decorators

    4 topics
    • Closures and Free Variables
    • Writing Decorators
    • Decorators with Arguments
    • functools Utilities

Functions and Functional Programming flashcards for Python Programming

18 of 50 cards from the Functions and Functional Programming deck — real questions with worked answers.

  1. What keyword defines a function in Python, and what does a function return if no return statement is executed?

    Functions are defined with the def keyword. If no return statement runs (or return has no value), the function returns None.

  2. What is the difference between a parameter and an argument?

    A parameter is the variable named in the function definition; an argument is the actual value passed to the function when it is called.

  3. Distinguish positional arguments from keyword arguments in a function call.

    Positional arguments are matched to parameters by order/position; keyword arguments are matched by explicitly naming the parameter (e.g. func(x=5)).

  4. What do *args and **kwargs collect in a function definition?

    *args collects extra positional arguments into a tuple; **kwargs collects extra keyword arguments into a dict.

  5. Why can using a mutable object (like a list) as a default parameter value be dangerous?

    The default is evaluated once at definition time and shared across all calls, so mutations persist between calls. Use None as the default and create the object inside the function instead.

  6. What is a docstring and how do you access it programmatically?

    A docstring is a string literal placed as the first statement in a module, function, class, or method to document it. It is accessed via the object's __doc__ attribute (or help()).

  7. Which quoting style is conventionally used for docstrings and why?

    Triple double-quotes ("""..."""), because they allow multi-line text and can contain single quotes without escaping.

  8. Define local scope and global scope.

    Local scope is the namespace inside a function, existing only during its execution. Global scope is the module-level namespace accessible throughout the module.

  9. What happens if you assign to a variable inside a function that also exists globally?

    By default the assignment creates a new local variable that shadows the global; the global is unchanged unless you declare it with the global keyword.

  10. What does the global keyword do?

    It tells Python that a name inside a function refers to the module-level (global) variable, so assignments modify the global rather than creating a local.

  11. What does the nonlocal keyword do?

    It binds a name to the nearest enclosing (non-global) function scope, allowing an inner function to reassign a variable in an outer enclosing function.

  12. What error occurs if you use nonlocal without a matching enclosing variable?

    A SyntaxError, because nonlocal requires an existing binding in an enclosing function scope (it cannot create one and cannot refer to global scope).

  13. State the LEGB rule and what each letter stands for.

    LEGB is the order Python searches names: Local, Enclosing (enclosing functions), Global (module), Built-in. The first match found is used.

  14. In the LEGB rule, where does Python look last for a name?

    In the Built-in scope (the builtins module, e.g. len, print, range), which is searched after Local, Enclosing, and Global fail.

  15. What is a lambda expression and how does it differ from a def function?

    A lambda is an anonymous function written inline as 'lambda args: expression'. It has no name, its body is a single expression (no statements), and it returns that expression's value automatically.

  16. Can a lambda contain multiple statements or assignments?

    No. A lambda body must be a single expression; it cannot contain statements, assignments, or annotations (though it can use conditional expressions).

  17. What does map(function, iterable) do and what does it return?

    It applies function to each element of the iterable and returns a lazy map object (an iterator) yielding the results. Wrap in list() to materialize.

  18. What does filter(function, iterable) return?

    A lazy iterator yielding only the elements for which function(element) is truthy. If function is None, it keeps the truthy elements.

See more Functions and Functional Programming flashcards →

Planning Functions and Functional Programming for Python Programming

Functions and Functional Programming is about 13% of the Python Programming syllabus by topic count — 16 of 121 topics, spread over 5 chapters. At roughly 45 minutes per topic plus 12 minutes per sub-topic, a first pass runs to about 10 hours.

The heaviest chapters are Closures and Decorators (4 topics), Defining Functions (3 topics), Scope and Namespaces (3 topics) . Front-load those while your energy is high; the short chapters are better revision filler later.

Work top-down: read the chapter, then tick topics off individually rather than marking the whole chapter done. Sub-topics are where silent gaps hide.

Functions and Functional Programming (Python Programming) FAQ

What is in the Python Programming Functions and Functional Programming syllabus?

Functions and Functional Programming is split into 5 chapters — Defining Functions, Scope and Namespaces, Lambda and Higher-Order Functions, Iterators and Generators and Closures and Decorators, containing 16 topics and 0 sub-topics in total.

How is Functions and Functional Programming structured in the Python Programming syllabus?

5 chapters. Functions and Functional Programming accounts for about 13% of the topics in the whole Python Programming syllabus (16 of 121).

How long should I spend on Functions and Functional Programming for Python Programming?

Budget around 10 hours for a first pass through Functions and Functional Programming — about 45 minutes per topic plus 12 minutes per sub-topic across its 16 topics. Add revision cycles on top.

Are there flashcards for Python Programming Functions and Functional Programming?

Yes — a 50-card Functions and Functional Programming deck. Sample cards are printed on this page, and the full deck is free in the Examius app with spaced repetition scheduling.