Identifier
A unique name for something (e.g. variable, constant, procedure, etc.) within the program
Variable
An identifier associated with a specific memory location, used to store data. Its value can change while a program runs
Constant
A named value within a program with a fixed value that does not change while the program runs
What are the benefits of declaring a constant? (2)
Variable names in Python can… (2)
2. Use any upper- or lowercase letters, the underscore and the digits 0—9
Variable names in Python cannot… (2)
2. Contain special characters (e.g. +, =), as they already have reserved uses
Why aren’t variable names beginning with underscores encouraged?
A considerable number of names beginning with underscores are already reserved for use by the system
How would you write “Pascal case” in Pascal case?
PascalCase
How would you write “camel case” in camel case?
camelCase
Data type
The type of data stored in a variable
What does the data type of a variable define? (3)
Integer
Data type for whole numbers
Real OR Float
Data type for fractional numbers
Character
Data type for a single character
String
Data type for text (over 1 character). Sometimes limited to a length of 255 characters
Boolean
A true or false value
How much memory is typically needed to store:
Assignment
When a variable is given a value
Initialisation
Explicitly setting the starting values of variables
Algorithm
A series of instructions that solves a specific problem
What are the three main parts of program flow control?
Sequence
Where instructions are executed one after another in series
Selection
Where the program executes certain instructions based on a condition
The two basic selection constructs are…
*Do not exist in Python