May 2026
Intermediate to advanced
418 pages
9h 29m
English
The examples in Part 2, “NAPALM,” use simple, explicitly written loops to process structured data returned by NAPALM. This approach is intentional, to keep the logic easy to follow for readers who are still becoming comfortable with Python.
For readers who wish to explore a more flexible and reusable technique, this appendix provides an example of using a recursive function to process nested dictionaries and lists of arbitrary depth. Recursion is a programming technique in which a function calls itself in order to solve a problem by breaking it into smaller, similar pieces.
Rather than assuming a fixed structure, the function shown in Example F-1 automatically walks ...
Read now
Unlock full access