

Iteration
Presentation
•
Computers
•
7th Grade
•
Practice Problem
•
Medium
Andy Wilkinson
Used 2+ times
FREE Resource
9 Slides • 4 Questions
1
Iteration
By Mr Wilkinson
2
Learning Objectives
Understand the use of following constructs in programming - Iteration
Lesson Components
To understand what is meant by iteration.
To write a program that draws basic shapes using counter-controlled iteration (FOR Loop).
To adapt a program for the number of times it needs to repeat for a given purpose.
3
Iteration
Iteration is a process of repeating steps.
It's the final programming construct along sequence and selection.
In programming we use something called "Loops".
A loop is a programming construct that repeats a block of code until a specific condition is met.
4
Iteration
"For Loop"
A for loop repeats code for each item in a sequence or a set number of times. Use it when you know how many repetitions you need.
What will the outcome be if the user enter the number 10?
5
Iteration
It keeps repeating what is in the for loop under the it hit's the number we enter, in our case "10"
6
Iteration
"While Loops"
A while loop repeats code as long as a condition stays true. Use it when you don't know how many repetitions you need.
What's happening here?
7
Multiple Choice
Which type of loop would you use for this scenario:
Print "Happy Birthday" exactly 5 times:
For
While
8
Multiple Choice
Which type of loop would you use for this scenario:
Keep asking for a password until the user enters "python123"
For
While
9
Multiple Choice
Which type of loop would you use for this scenario:
Display each name in a list of 10 students
For
While
10
Multiple Choice
What's going to be the output here?
2
2
3
4
5
6
2
4
2
4
6
11
New Information
The turtle module allows you to draw shapes.
Which shape do you think is code will draw?
How could we use less blocks of code to draw the same shape.
12
New Information
We could have used a "For Loop"
13
Today's worksheet
Iteration
By Mr Wilkinson
Show answer
Auto Play
Slide 1 / 13
SLIDE
Similar Resources on Wayground
10 questions
Unit Rate and Graphs
Presentation
•
7th Grade
9 questions
Find the constant of proportionality from a graph
Presentation
•
7th Grade
9 questions
Theme vs. Main Idea
Presentation
•
7th Grade
11 questions
Semi Circle and Quarter Circle
Presentation
•
7th Grade
11 questions
METABOLISM
Presentation
•
7th Grade
11 questions
Area of Composite Shapes
Presentation
•
7th Grade
11 questions
HTML coding
Presentation
•
7th Grade
10 questions
Keyboard Shortcuts
Presentation
•
7th - 8th Grade
Popular Resources on Wayground
24 questions
PBIS-HGMS Day 10
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Review 3
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
15 questions
HCS SCI 05 Summer School Assessment 3 Review
Quiz
•
5th Grade
35 questions
Lufkin Road Middle School Student Handbook & Policies Assessment
Quiz
•
7th Grade
18 questions
Geo 11.3 Area of Circles and Sectors
Quiz
•
9th - 11th Grade