A Byte of Py: For Loops

This is the first of a new series “A Byte of Py” where I share tasty Python concepts in around 256 seconds (for the video that is). I had this post planned for a long time and I’m only getting to it now, so it might not be the best. Enjoy 🙂


In this Byte of Py, I’ll explain how for loops work in Python using the range statement, enumerate, dictionaries and enhanced for loops in addition to the for-else construct.

There’s also a handy GIF I created explaining for loops.

for-loop

Advertisements

One thought on “A Byte of Py: For Loops

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s