Skip to main content

Introduction

Loops

Have you ever gotten tired of writing the same line of code multiple times to no end? Well thankfully languages like Python have a neat way to remedy this and they are known as loops!

Loops are an element of programming that allow portions of code to be repeated a set number of times until the process is complete. As programmers we will see repetitive tasks. Using loops will help us save time and write more effective code!

In the following sections you will be introduced to two types of loops: for-loop and while-loop