Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Computer Science

Similar presentations


Presentation on theme: "Introduction to Computer Science"— Presentation transcript:

1 Introduction to Computer Science
Programming with Python

2 Loops & Iteration Chapter 5

3 Loops & Iteration This is where we ask the computer to perform repetitive tasks Computers are very fast at executing tasks, so why not ask them to do repeated tasks for us Loops & Iteration are extremely significant in most programming language This is a concept in all programming languages Syntax is very similar to other programming languages Remember, if the concept is understood, it is always easy to pick up syntax and migrate to other programming languages or learn other programming languages

4

5

6

7 Next iteration Get out

8 Continue and Break Continue does not stop the loop, it takes you to the next iteration and skips any line that is in the loop after continue Break terminates the loop completely, and executed the next code that is outside the loop block

9 While Loops While loops are sort of indefinite, you can construct them cleverly While loops keeps on repeating until a condition becomes false


Download ppt "Introduction to Computer Science"

Similar presentations


Ads by Google