Y8

HT6: Python

Revision tools
You can print this page for a quick reference guide or you can use the tools below to create printable test sheets
6a: Describe what algorithms and programs are and how they differ
Python
KeywordDefinition
algorithmstep by step instructions to solve a problem (which might not be run on a computer)
programstep by step instructions to solve a program (which can be run on a computer)
6b: Recall how machines need translators for executing programs.
Python
KeywordDefinition
high level programming languagea type of programming language where you can perform complex tasks with only a few instructions
low level programming languagea type of programming language where you need lots of detailed instructions to perform even simple tasks
machine codecode that is hard for humans to understand but can be easily understood by a computer
program codecode that is designed to be easy for human programmers to understand but is hard for a computer to run in its current form
translatora software tool that is used to convert program code into machine code
6c: Use an IDE to write and execute a Python program.
Python
KeywordDefinition
debugfinding and fixing errors in code
IDEintegrated development environment (program which gives you all the tools to write, run and debug a program)
programstep by step instructions that can be run on a computer
pythona high level text based programming language
syntaxthe rules of a programming language
syntax highlightingdisplaying code in different colours based on what each part of the code does
6d: Locate and correct common syntax errors.
Python
KeywordDefinition
bracketssyntax errors often occur if ( { and [ are missing matching ] } and )
debuggingfinding and fixing errors in code
indentationsyntax errors often occur if code has the wrong amount of tabs or spaces at the start of each line
line numberseach line of code has a number which can be used to help find errors
syntax errora type of error which prevents code from running at all because the rules of the programming language have been broken
6e: Use simple arithmetic expressions in assignment statements to calculate values
Python
KeywordDefinition
arithmetic expressionscombinations of variables, operators and numbers to calculate a value
arithmetic operatora mathematical symbol such as add (+), subtract (-), divide (/) or multiply (*)
assignment statementstoring a value into a variable
valuesdata such as a number
variablea named memory location which can store a value
6f: Receive input from the keyboard and convert it to a numerical value
Python
KeywordDefinition
characterindividual letter, digit or symbol
floata number with a decimal point
inputbuiltin python function which asks the user to type something in
integera whole number (no decimal point)
stringtext made up of multiple characters
6g: Use relational operators to form logical expressions
Python
KeywordDefinition
!=relational operator which means "not equal to"
<relational operator which means "less than"
<=relational operator which means "less than or equal to"
==relational operator which means "equal to"
>relational operator which means "greater than"
>=relational operator which means "greater than or equal to"
logical expressiona value which can only be one of either true or false
relational operatorsymbol or symbols which are used to compare two values
6h: Use binary selection (if, else statements) to control the flow of program execution
Python
KeywordDefinition
elifselection statement which will only run the next indented block if a previous condition has not been met but a different condition is met
elseselection statement which will only run the next indented block if a condition has not been met
ifselection statement which will only run the next indented block if a condition has been met
indented blocklines of code which share the same amount of spaces or tabs at the start
program flowthe order in which lines of code are executed in a program
6i: Generate and use random integers
Python
KeywordDefinition
importinstruction which tells python how to find and use an external module of code
integera whole number
parameterdata which is passed into a subprogram to customise how it works (e.g. minimum and maximum random numbers to choose between)
randoma module which can be imported to tell python how to choose random numbers
return valuedata which is passed out from a function back to the code which called the function (e.g. a number chosen at random)
6j: Use multi-branch selection (if, elif, else statements) to control the flow of program execution
Python
KeywordDefinition
elifselection statement which will only run the next indented block if a previous condition has not been met but a different condition is met
elseselection statement which will only run the next indented block if a condition has not been met
ifselection statement which will only run the next indented block if a condition has been met
indented blocklines of code which share the same amount of spaces or tabs at the start
program flowthe order in which lines of code are executed in a program
6k: Describe how iteration (while statements) controls the flow of program execution
Python
KeywordDefinition
conditionan expression which can contain values, variables and operators to calculate a value which is either True or False
indented blocklines of code which share the same amount of tabs or spaces at the start
iterationrunning lines of code multiple times
program flowthe order in which lines of code are executed
while statementform of iteration which runs an indented block of code repeatedly as long as a condition is met
6l: Use iteration (for loops) to control the flow of program execution
Python
KeywordDefinition
for loopa type of iteration where an indented block of code is repeated a certain number of times
indented blocklines of code which have the same number of spaces or tabs at the start
indexa variable that is used to keep track as iteration loops through a range of values
iterationrunning an indented block of code multiple times
program flowthe order in which lines of code are executed
6m: Use variables as counters in iterative programs
Python
KeywordDefinition
assignmentstoring a value in a variable
decrementdecreasing the value stored in a variable by 1
incrementincreasing the value stored in a variable by 1
indexa variable that is used in a while or for loop to keep track of of how many times the loop has repeated
iterationrepeating lines of code multiple times
variablea named memory location which can store a value which may change as a program runs
variable identifierthe name of a variable which describes the value it stores
variable valuethe data stored in a variable
6n: Combine iteration and selection to control the flow of program execution
Python
KeywordDefinition
iterationrunning instructions multiple times (in a loop)
program executionrunning a program
program flowthe sequence (order) in which lines of code are executed
selectionrunning instructions which determine which other instructions should be run next
6o: Use Boolean variables as flags
Python
KeywordDefinition
boolean flaga variable which stores either True or False as a way of controlling a program (e.g. whether or not a player is still alive in a game or not)
boolean valueeither True or False
variablea named memory location which can store a value that might change when the program runs
variable identifierthe name of a variable which should describe the data that it stores
variable valuethe data stored in a variable