LPTHW: Exercise 5: More Variables and Printing and Prepping Collards

In Learn Python the Hard Way’s exercise five, we continue with variables and printing them, only they look a little different. Specifically, I embed variables within format strings. A string is just a piece of text within double-quotes. A format string has a variable at the end with a special syntax that tells Python to insert the variables.

Here’s the exercise:

ex5py

In the study drills, Zed asks us to adjust all the variables so that they no longer begin with “_my”. He also has us write variables that convert the inches and pounds to centimeters and kilograms. Finally, we’re asked to search online for all the Python format characters and try a few more out. As he says, %r is very useful: “it’s like saying ‘print this no matter what’.”

No surprises from Python in this lesson, but IRL, Georgia weather provokes the usual mid-November panic as temperatures suddenly plunge. Our first frost was last weekend, a fact made painfully obvious when I went out Friday night and saw my fellow revellers in various states of confused dress. While we hunt our hats and scaves, some farmers are feeling good about the drop, because it means that forthcoming crops of collard greens and other leafy brassicas will be at their peak. Frost kills our favorite tender annuals — basil, peppers, pretty summer flowers — but growers insist that it’s a boon to collards, transforming them into a sweeter, more delicious green. I’m not sure we have any hard data on this, but I do know that this is my favorite time of year to prepare and eat collards.

collards upon collards
And I’m certainly not alone. Southerners pair collards with all of their holiday feasts, particularly New Year’s, when they’re regarded as particularly auspicious. At Your Dekalb Farmer’s Market in Decatur, above, workers have to bring collards in by the pallet!

Also evident: collards are giant greens, usually some of the biggest in the grocery store. (A lot of places around here even have special “greens bag” near the collards, which, while more than twice the size of other produce bags, still don’t contain their bounty.) This fact can be intimidating to some folks, who give up without trying. No more! Follow the steps below to dispatch these leaves quickly and with confidence.

01
Start with clean collards. Fill a (clean) sink with water and add leaves, swishing them around to let any sand fall to the bottom of the sink. If you feel it’s necessary, you can do a second rinse. Sometimes collards are really dirty.

02

Grab a leaf and trim out the tough center with a sharp knife.

03

Stack the two sides of the leaf.

04

Roll up tightly.

05

Slice the roll down the center.

06

Chop into strips. Done!

Now, some might call what I’ve demonstrated above a chiffonade, and while it’s true that the process is almost identical – stack leaves, roll, slice – you’ll see that in the final step I chop the collards thickly, instead of into the true “little ribbons” of chiffonade. A fine distinction, but one I feel is worth mentioning! I did so because I planned to use these collards in a traditional stewed dish, where they cook in a flavorful broth for an hour or more, and I didn’t want them to disintegrate in the process. However, for a quick stovetop stir-fry, feel free to slice the collards as thinly as you’re able. Collards are tougher than most greens; a tight shred means they cook quickly and tenderize easily.

One thought on “LPTHW: Exercise 5: More Variables and Printing and Prepping Collards

  1. Pingback: LPTHW: Exercises 7, 8, 9, 10… and kale! | Coding with Knives

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s