Python for GCSE

5: Iteration

Revision tools
You can print this page for a quick reference guide or you can use the tools below to create printable test sheets
5.1: use definite iteration and understand how to iterate over a list
definite iterationrepeating a set of instructions a specific number of times (e.g. a for loop)
iterationrepeating a set of instructions multiple times
listdata structure which can store multiple values. Like an array but it's possible to add and remove values to a list.
5.2: use indefinite iteration and nested iteration structures
indefinite iterationrepeating a set of instructions either forever or until a condition is met (e.g. a while loop)
nested iterationa repeating set of instructions that loops within another repeating set of instructions (e.g. a for loop inside another for loop)
5.3: be able to determine what value a variable will hold at a given point in a program (tracing)
tracestep through a program one line at a time
trace tablea table used to record how the value of each variable changes as a program runs through each line of code
valuea piece of data that can be stored in a variable
variablea memory location with a name that can store an individual value
5.4: be able to determine the strengths and weaknesses of a program and suggest improvements
accuracya measure of how correct the output of a program is (e.g. 1+1 should equal 2)
efficiencya measure of how quickly the program runs or how much memory it needs
reliabilitya measure of how often the program behaves as it should (e.g. running the program 10 times should give the same result)
robustnessa measure of how the program copes without crashing (e.g. 1 + "potato" should show a friendly error message but shouldn't crash a calculator)