python-I-loop


Looping is a control flow statement that is used to repeatedly execute a group of statements as long as the confition is satisfied. There different type of *control flow statements” in python. Here’s the most used.

Here an hands-on example to practice looping (but also collections) 🦗⬇️⬇️⬇️ Download the start gh script file here ⬇️⬇️⬇️🦗 🦗⬇️⬇️⬇️ Download the end gh script file here ⬇️⬇️⬇️🦗


For-loop

# This is a simple loop
for i in range(10):
····print(i)

While-loop

# This is a while loop
# It will run until the condition is true
i = 0
while (i < 10):
····print(i++)

We will go more in depth in different variations and usage of looping in Python in the next guided exercises. At this stage, this is the minimum survival kit for control flow statements in python.