1/73
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Variable Declaration
Creates a variable to store data.
Constant Declaration
A value that does not change while the program runs. Often given fully uppercase identifiers.
Assignment
Setting or updating a value in a variable.
Input
Receiving data from the user.
Output
Displaying data or information to the user.
Sequence
Instructions executed in order.
Selection
Decisions (IF, ELSE).
Iteration
Repetition (WHILE, FOR).
Arithmetic Operations
The basic mathematical calculations that can be performed in a programming language.
Addition
Operation symbol: +, Example: 3 + 2, Result: 5.
Subtraction
Operation symbol: -, Example: 7 - 4, Result: 3.
Multiplication
Operation symbol: *, Example: 5 * 3, Result: 15.
Real Division
Operation symbol: /, Example: 10 / 4, Result: 2.5.
What does the modulus operation (MOD) find?
The remainder when one number is divided by another number.
What is the operation symbol for modulus?
%
What is the result of the operation 5 % 2?
1
What is the definition of a quotient?
The number we obtain when we divide one number by another.
What is the operation symbol for division in programming?
//
What is the result of the operation 8 // 3?
2
Exponentiation
Operation symbol: ^, Example: 4^2, Result: 16.
Comparison Operations
Used to compare different items of data, returning True or False.
Equal to
Operation symbol: ==, Example: 5 == 5, Result: True.
Not equal to
Operation symbol: !=, Example: 3 != 4, Result: True.
Less than
Operation symbol: <, Example: 2 < 5, Result: True.
Greater than
Operation symbol: >, Example: 6 > 7, Result: False.
Less than or equal to
Operation symbol: <=, Example: 5 <= 5, Result: True.
Greater than or equal to
Operation symbol: >=, Example: 7 >= 10, Result: False.
Boolean Operations
Logical operators that work with Boolean values (True or False).
NOT
Reverses the Boolean value.
AND
Returns True if both input conditions are true.
OR
Returns True if either input condition is true.
Data Types
Defines the kind of data a variable or constant can hold.
Integer (int)
Whole numbers only, no decimals.
Real (float)
Numbers that include a fractional/decimal part.
Boolean (bool)
Often used for conditions and logic, can be True or False.
Character (char)
A single symbol or letter, must be enclosed in quotation marks.
String (str)
A sequence of characters.
Integer
A data type representing whole numbers.
String
A data type representing a sequence of characters.
Casting
Changing data types of a variable, for example from integer to string.
String Manipulation
Refers to measuring the length of strings, concatenating strings or slicing strings.
Length
Returns the number of characters in a string.
subString
Extracts a sequence of characters within a string.
Concatenation
Joins strings together.
File Handling
Refers to the reading or writing to or from an external file.
Read Mode
A mode in which a file is opened for reading.
Write Mode
A mode in which a file is opened for writing.
Data Structure
A way of organising and storing related data so it can be used efficiently in a program.
Record
A data structure used to group different types of data under one structure.
Array
A fixed-size data structure with a collection of similar data items stored under a single name.
One-Dimensional Array (1D)
A single list of items.
Two-Dimensional Array (2D)
An array of arrays, like a database table or grid.
Database
Used to store large amounts of data into organised tables.
Structured Query Language (SQL)
A language used to search for, manage, and manipulate data in a database.
SELECT
An SQL command used to specify the data to be retrieved.
FROM
An SQL command used to specify the table from which to retrieve data.
WHERE
An SQL command used to specify conditions for data retrieval.
SELECT command
Used to retrieve information about a particular field in a database.
FROM command
Refers to the database being searched.
WHERE command
Used to apply conditions to a search.
SQL command structure
Takes the form: SELECT
Wildcard * in SQL
Used to represent all fields in the SELECT command.
Subprogram
A section of code which performs a specific task, and can be called whenever it is needed.
Functions
A type of subprogram that performs a task and returns a value.
Procedures
A type of subprogram that performs a task and does not return a value.
Parameters
Values which can be passed into a subprogram when it is called.
Local variables
Defined inside of a subprogram and can only be used inside of that subprogram.
Global variables
Defined in the main program and can be used anywhere, including all subprograms.
Why use Subprograms?
They make code more structured and modular, allow code to be reused, make programs easier to test and maintain, and allow shared workload.
Random Number Generation
The ability to produce unpredictable numeric values within a specified range.
RANDOM_INT function
Used to generate a random integer within a specified range.
random.randint function in Python
Generates a random integer within a specified range, inclusive of the endpoints.
Typical Uses of Random Number Generation
Rolling a die, picking a random question or card, generating test values for simulations, and randomly deciding outcomes in games.
Good Practice for Random Number Generation
Store the random value in a variable if it will be used more than once.