Jinja list comprehension examples ("Them Apples")
Practice writing list comprehension, using Jinja, to create a new list from existing list data.
Last updated
Was this helpful?
Practice writing list comprehension, using Jinja, to create a new list from existing list data.
Last updated
Was this helpful?
💡 Let's explore list comprehension with two examples, focusing on how the output (first part) and condition (last part, optional) can be used.
Picture this: a basket of apples labeled "them_apples." Each apple has attributes like color, shape, and brand name (e.g., Granny Smith, Red Delicious). We’ll use these details to build two different lists.
Practice the Lunch Menu exercises that use list comprehension.
Post further questions about list comprehension in the #cluck-u Rewst Discord channel to get help from professors and peers!
Go to the previous module:
Go to the next module: