Introduction to Loops

In this lesson, you will be introduced to the functionality of loops.

Introduction

Suppose we have 1000 boxes in a warehouse. We want a robot to move all boxes from one point to another. The robot is pretty dumb, so we must teach it how to move one box in great detail. We will provide the robot with the following instructions:

  1. Go to point A.

  2. Lift the box and load it.

  3. Move to point B.

  4. Unload the box here.

Then, we will ask it to repeat the same steps for the rest of the boxes until there are no more boxes at point A.

Get hands-on with 1400+ tech skills courses.