Y9

HT5: 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
5a: Write programs that display messages, receive keyboard input, and use simple arithmetic expressions in assignment statements
Python
KeywordDefinition
algorithmstep by step instructions to solve a problem (which may or may not involve a computer)
arithmetic expressiona calculation using mathematical operators like add, subtract, division or multiplication
assignmentsetting the value of a variable
identifierthe name of a variable
inputdata that goes into a program (e.g. something you type in on a keyboard)
outputinformation that comes out from a program to the real world (e.g. a message on the screen)
programan algorithm that's written in code so it can be run on a computer
statementa line of code that tells a program what to do
valuethe data stored in a variable
variablea named location in memory which can store a value. The value can change when the program runs.
5b: Use selection (if-elif-else statements) to control the flow of program execution
Python
KeywordDefinition
conditionan expression which can be calculated into an answer of either True of False
elifprogramming statement which only runs the next block if a condition is met but all other linked conditions haven't been met
elseprogramming statement which runs the next block of code if no other linked conditions have been met
executionrunning a program on a computer
expressioncombination of values, variables, operators and function calls
ifprogramming statement which only runs the next block of code if a condition is met
program flowthe order in which the program runs each line (which might not be just top to bottom in order)
selectionstatements in code which tell a program which code to execute next by checking if a condition has been met
5c: Locate and correct common syntax errors
Python
KeywordDefinition
indentation errortype of syntax error which happens when lines of code aren't indented correctly (moved across from the left of the screen) to match where python expects them to be
missing colona type of syntax error where an indented block of code doesn't have a line above it which ends with a colon
syntax errora type of error which prevents code from being run which happens when you break the rules of the programming language
unbalanced bracketsa type of syntax error where part of the code isn't surrounded with the correct type of brackets on both sides
unbalanced quotesa type of syntax error where text isn't surrounded on both sides with the correct type of quotation marks
5d: Create lists and access individual list items
Python
KeywordDefinition
identifierthe name of a list
indexthe position in a list (where 0 means the first item in the list)
indexing expressiona calculation (which could be a combination of values, variables, function calls and operators) to work out which position in a list you want to look at
listdata structure which allows python to store multiple values in a specific order within the same variable
valuesthe data items that are stored within a list
5e: Perform common operations on lists or individual items
Python
KeywordDefinition
appenda method (code you can call) for any list which allows you to insert a new value into a list
identifierthe name of a list
inpython keyword which allows you to check if a value is stored in a list
indexthe position in a list (where 0 means the first item in the list)
indexing expressiona calculation (which could be a combination of values, variables, function calls and operators) to work out which position in a list you want to look at
lenbuilt in python function which can work out the length of a list by counting how many values it holds
listdata structure which allows python to store multiple values in a specific order within the same variable
removea method (code you can call) for any list which allows you to delete a value from a list
valuesthe data items that are stored within a list
5f: Use iteration (while statements) to control the flow of program execution
Python
KeywordDefinition
conditionan expression which can be evaluated (calculated or worked out) as either True or False
executeto make a program run on a computer
expressiona combination of values, variables, function calls and operators
function callan instruction to run a sub program to calculate something and return the result
iterationrepeating code mutliple times
operatora symbol that performs an operation (e.g. add or subtract)
program flowthe order in which instructions are executed
valuea number, text or other data item
variablea name which represents a location in memory which stores a value. The name stays the same but the value might change when the program runs.
while statementa type of iteration which keeps repeating code as long as a condition is met
5g: Perform common operations on strings or individual characters
Python
KeywordDefinition
=operator used to assign a string to be stored in a variable
==operator which can compare two strings to see if they are identical
charactera single letter, numerical digit, punctuation mark or space
concatenatejoining together two strings with the + operator to make one new, longer string
indexthe position within a string (where 0 is the first character)
lenbuilt in python function which can work out how long a string is by counting all of the characters
lowera method that can be called for any string which converts each character into lowercase letters
stringa type of data which is made up of zero or more characters
substringa smaller part of a string (for example one or more characters in a sentence)
uppera method that can be called for any string which converts each character into uppercase letters
variablea named memory location that can be used to store strings or other data
5h: Use iteration (for statements) to iterate over list items
Python
KeywordDefinition
for statementa type of iteration where you can repeat a block of code for each value in a list
indentationmoving a block of code away from the left side of the code editor so that python knows which lines of code to repeat
iterationrepeating a block of code multiple times
lista data structure which can store multiple values in a specific order
list itemsthe values stored in a list
rangepython built in function which generates something similar to a list of numbers that starts and stops at certain values
variablenamed location in memory that stores a value. The name stays the same but the value can change when the program runs
5i: Perform common operations on lists or strings
Python
KeywordDefinition
appendadding a new value on to the end of a list
concatenateadding new characters on to the end of a string
inkeyword in python which allows you to check if a value is in a list or a character is in a string
indexthe position within a list or string that you want to look at (where 0 is the first position)
indexing expressiona combination of values, variables, function calls and operators which can work out the index of a list or string you want to look at
lenbuilt in python function which finds the length of a list or string by counting how many values of characters it stores
5j: Use iteration (for loops) to iterate over lists and strings
Python
KeywordDefinition
characteran individual letter, digit or punctuation mark
data structurea special type of variable which can store more than one value
for loopa type of iteration where a block of code is repeated for each item in a data structure such as a list or string
indentationmoving a block of code over from the left of the code editor so that you know which lines of code should be repeated in a for loop
iterationrepeating a block of code multiple times
lena built in python function which can find the length of a list or string by counting the values or characters stored inside
lista data structure which stores multiple values in a specific order (e.g. different colours of the rainbow)
stringa data structure which stores multiple characters in a specific order (e.g. a sentence)
variablea named location in memory which can store a value. The name doesn't change but the value stored might change when the program runs.
5k: Use variables to keep track of counts and sums
Python
KeywordDefinition
assignmentsetting the value stored in a variable to a specific value
incrementan instruction to increase the value stored in a variable by a certain amount (usually increasing it just by one)
operatora symbol which tells python to perform an operation (e.g. add, subtract, divide or multiply)
outputdisplaying something to the screen (e.g. the value stored in a variable)
valuethe data stored in a variable
variablea named location in memory which can store a value. The name should describe what data represents and its value might change when the program runs.
5l: Combine key programming language features to develop solutions to meaningful problems
Python
KeywordDefinition
commentslines of code which are ignored by the computer when you execute the program but which explain the code for any humans who need to change or understand the program
indentationmoving blocks of code away from the left side of the code editor to determine the program flow
inputreading data in from the real world into a python program (e.g. letting the user type something in)
iterationrepeating blocks of code multiple times
outputdisplaying the results of a program to the user (e.g. showing something on screen with the print function)
processmaking a calculation or working something out based on the inputs to a program
program flowthe order in which lines of code are executed
selectiondeciding which lines of code to run next based on whether a condition is True or False
sequencerunning multiple instructions in a specific order