Beginners Guide to Python, Part3: For Loops

For loops for noobs. Let's get loopy!

Niall McNulty
The Startup

--

Hello fellow learners, I hope everyone is happy and healthy! Also a big welcome back to those of you who have been following my ‘Beginners Guide to Python’. Today we will crack on with for loops. During the first week or two of my data science boot camp, loops were the bane of my existence. It took me a while to understand the concepts and syntax. The above gif pretty much sums up how I felt during those early weeks. My goal for today's lesson is to present loops in such a way that beginner coders won't go through what I did (or to a lesser extent) and come out with a basic understanding of how loops operate.

Alrighty, let's get to it!

Iteration

Iteration, in the context of computer programming, is a process wherein a set of instructions or structures are repeated in a sequence a specified number of times or until a condition is met. When the first set of instructions is executed again, it is called an iteration. When a sequence of instructions is executed in a repeated manner, it is called a loop.

With all this coding jargon you may be getting a little confused. Worry not as I’ve added a gif to help…

--

--

Niall McNulty
The Startup

I’m a junior data scientist who enjoys long-distance running, football, travelling, reading, food, programming… the list could go on. Never stop learning!