- Practical Network Automation
- Abhishek Ratan
- 270字
- 2021-07-02 15:21:52
Loops
A loop, as we know in common language, is circling the same path over and over again. In other words, if I am asked to fetch five ice creams from the ice cream store, and I can carry only one ice cream at a time, I will repeat the process of going to the ice cream shop to purchase ice cream five times. Correlating this with programming, if the same set of instructions need to be performed multiple times, then we put those instructions inside a loop.
A very basic loop is generally depicted as an iteration of a variable as many times as we want the instructions to be carried out.
Let's take an example:
Start the loop from one, until the loop has been repeated sixty times, adding a value of 1 to the loop:
Perform action
If you see the instructions being passed, there are three separate segments that are depicted in a loop:
- Start the loop from one: This means that the loop should start with a value of one.
- until the loop has been repeated sixty times: This means perform the same set of tasks until the loop has completed sixty turns of execution.
- adding a value of 1 to the loop: This means that we dictate that after completion of each round of loop, increment the loop count by 1.
The result will be the same action performed sixty times, until the loop count reaches sixty. Additionally, a loop can used to iterate through multiple values stored in a variable irrespective of whether it is an integer, string, or any other data type.
- Managing Mission:Critical Domains and DNS
- Practical Data Wrangling
- 實時流計算系統設計與實現
- 機器人智能運動規劃技術
- AI 3.0
- Cloudera Administration Handbook
- Lightning Fast Animation in Element 3D
- Learn CloudFormation
- Building a BeagleBone Black Super Cluster
- Visual FoxPro程序設計
- 自動化生產線安裝與調試(三菱FX系列)(第二版)
- Visual Studio 2010 (C#) Windows數據庫項目開發
- 三菱FX/Q系列PLC工程實例詳解
- 設計模式
- Deep Learning Essentials