Basic Programmatic Logic

Let's learn some basic programming concepts like "if" statements and "for" loops using the Jinja2 templates.

We'll cover the following

Basics

Even a beginner can write the basic logic statements required to create dynamic templates. Having already created the data dictionary, it is now a simple matter of learning and understanding the syntax required to unlock the information. The previous example, 01_ios_global.j2, also contains some dynamic templating required to handle the various unique platform differences or to substitute dynamic information to variables. Here is the rest of the template that includes the logical statements. Note that there are no spaces in the real template; they have been added to help with readability:

Get hands-on with 1200+ tech skills courses.