How to do a For loop in Python

Loops are a very powerful command to understand within Python, they allow us to repeat processes as many times as we want to without explicitly writing out lines of code for each instance. There are 2 main looping command within Python: For loop & While loop, both loops are similar but different, a for loop is used for iterating over a specified iteration (i’ll explain this later) where a while loop is a conditional statement iterating only if the statement is true, let’s go ahead and find out how to do a for loop!

For Loop

--

--

Data Scientist / Engineer!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store