Convert algorithms 5 (Edexcel GCSE Computer Science): Flashcards
📚Flashcards
Practise the cards
12 cards from this deck
ShowHide
Practise the cards
12 cards from this deck
What is iteration?
What is iteration?
Going through each item in a collection one by one
Python statement for iteration
Python statement for iteration
for...in statement
Alternative name for for...in statement
Alternative name for for...in statement
for each loop
Backward arrow in flowcharts indicates
Backward arrow in flowcharts indicates
A loop
Decision diamond in iteration checks for
Decision diamond in iteration checks for
If any items are left to process
What is the accumulator pattern?
What is the accumulator pattern?
Keeping a running total by adding to a variable in a loop
When to use count-controlled repetition
When to use count-controlled repetition
When you know exact number of iterations needed
When to use item-controlled iteration
When to use item-controlled iteration
To process every item in a collection
Initialize totals before loops to
Initialize totals before loops to
0
Initialize lists before loops to
Initialize lists before loops to
Empty []
Import needed for random numbers
Import needed for random numbers
import random
What does the loop variable contain?
What does the loop variable contain?
The current item
