TK Study

Software Engineering › Flashcards › Python questions

Flashcards for Python questions

70 cards where the term can be tested as a python question. Study these as flip cards Random

Development Process Programming Fundamentals (Year 11)

Writing the code that implements the design in the chosen language, following the algorithms and good coding practice (comments, naming, modular subroutines).

Example: Development turns the design into working code.

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Python: Write the code from a design
  • Pseudocode: Write the algorithm

Related past questions: Sample exam Q21b (5 marks): Python: subroutines, lists, loops; 2025 HSC Q19 (3 marks): Developing secure code (Python)

Memorise: Software development steps and algorithm design

Sequence Term Programming Fundamentals (Year 11)

A control structure where statements run one after another in the order written.

Example: Every program uses sequence; selection and iteration change the order.

Where you would use it in the test
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Python: Python question: write or complete it in the online Python tool.
  • Drawing: flowchart
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design

Memorise: Software development steps and algorithm design

Selection Term Programming Fundamentals (Year 11)

A control structure that chooses which path to run depending on a condition: binary selection (IF ... ELSE), multi-way selection (CASEWHERE) or nested IF.

Example: 'Use IF/ELSE selection to output Pass when mark >= 50.'

Where you would use it in the test
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Python: if / elif / else
  • Drawing: flowchart decision diamond
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Related past questions: 2025 HSC Q19 (3 marks): Developing secure code (Python); 2025 HSC Q26 (5 marks): Design, construct and implement a solution (Python)

Memorise: Software development steps and algorithm design

Iteration (repetition) Term Programming Fundamentals (Year 11)

A control structure that repeats statements while or until a condition: pre-test loop (WHILE ... ENDWHILE), post-test loop (REPEAT ... UNTIL) or counted loop (FOR ... NEXT).

Example: 'FOR each item in the array: total = total + item.'

Where you would use it in the test
  • Pseudocode: Iterate through an array and sum it (2025)
  • Python: for / while loops
  • Drawing: flowchart loop
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design; 2025 HSC Q26 (5 marks): Design, construct and implement a solution (Python)

Memorise: Software development steps and algorithm design

Subroutine (module, subprogram, procedure) Term Programming Fundamentals (Year 11)

A named block of statements that performs one specific task and can be called many times; the terms subroutine, module, subprogram and procedure are used interchangeably in the course.

Example: 'One logical task per subroutine makes code reusable and easier to maintain.'

Where you would use it in the test
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Python: Python question: write or complete it in the online Python tool.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.

Related past questions: Sample exam Q14 (3 marks): Algorithm design (subroutines); Sample exam Q21b (5 marks): Python: subroutines, lists, loops

Memorise: Software development steps and algorithm design

Function v procedure Term Programming Fundamentals (Year 11)

A function returns a value to the caller (RETURN); a procedure carries out a task and does not return a value.

Example: 'def calc_total(a, b): return a + b' is a function.

Where you would use it in the test
  • Python: def with return
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Related past questions: Sample exam Q21b (5 marks): Python: subroutines, lists, loops; Familiarisation Q13 (6 marks): Python: lists, loops, selection

Memorise: Software development steps and algorithm design

Parameter and argument Term Programming Fundamentals (Year 11)

A parameter is a variable in the subroutine's definition that receives data; an argument is the actual value passed when the subroutine is called.

Example: 'def greet(name)' has parameter name; 'greet("Sam")' passes argument "Sam".

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Related past questions: Sample exam Q18b (3 marks): Developing secure code (Python input validation)

Memorise: Software development steps and algorithm design

Mainline Term Programming Fundamentals (Year 11)

The main algorithm that controls the program by calling subroutines in order. Good mainlines are clear and uncluttered.

Example: Put calls to your subroutines in the mainline, and call functions after they are defined (2025 Q19 marker note).

Where you would use it in the test
  • Pseudocode: Write mainline then subroutines (exam process)
  • Python: Python question: write or complete it in the online Python tool.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Related past questions: 2025 HSC Q19 (3 marks): Developing secure code (Python); Sample exam Q14 (3 marks): Algorithm design (subroutines)

Memorise: Software development steps and algorithm design

Recursion Term Programming Fundamentals (Year 11)

A subroutine that calls itself on a smaller version of the problem until it reaches a base case that stops it.

Example: 'Factorial: n * factorial(n-1) with base case n = 0.'

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Python: Python question: write or complete it in the online Python tool.

Memorise: Software development steps and algorithm design

Check this one: Not named in the 2022 syllabus text; included because of the functional paradigm and past SDD coding questions.

Data types Term Programming Fundamentals (Year 11)

The kind of value a variable holds: character, string, Boolean, integer, real (single-precision floating point) and date/time. The type decides how much memory it uses and what operations are allowed.

Example: 'Age = integer; price = real; isMember = Boolean; name = string.'

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Pick the data type for a field in a data dictionary or ERD
  • Python: Python question: write or complete it in the online Python tool.
  • SQL: SQL question: write or read it in the SQL query tool.

Related past questions: Sample exam Q9 (2 marks): Algorithm design (guessing game)

Memorise: Data structures

Integer Term Programming Fundamentals (Year 11)

A whole number, positive or negative, with no fractional part.

Example: Use int for counts and array indexes.

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Python: Python question: write or complete it in the online Python tool.

Memorise: Data structures

Boolean Term Programming Fundamentals (Year 11)

A data type with only two values, True or False, used in conditions.

Example: 'isLoggedIn = True' controls a selection.

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Python: Python question: write or complete it in the online Python tool.

Memorise: Data structures

Character and string Term Programming Fundamentals (Year 11)

A character is a single symbol; a string is a sequence of characters (text) such as a name.

Example: 'name = "Sam"' is a string; 'S' is a character.

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: 2025 HSC Q19 (3 marks): Developing secure code (Python)

Memorise: Data structures

Array Term Programming Fundamentals (Year 11)

A data structure holding a fixed number of items of the same type, accessed by index; can be single or multi-dimensional (rows and columns).

Example: 'marks[0]' is the first item.

Where you would use it in the test
  • Pseudocode: Iterate and sum an array
  • Python: 2D list
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design; Sample exam Q21a (1 mark): 2D arrays (Python); Sample exam Q21b (5 marks): Python: subroutines, lists, loops

Memorise: Data structures

Multi-dimensional array Term Programming Fundamentals (Year 11)

An array of arrays, used for grids or tables and accessed by row and column index, such as grid[row][col].

Example: 'grid[2][3]' is row 2, column 3.

Where you would use it in the test
  • Python: 2D list
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Related past questions: Sample exam Q21a (1 mark): 2D arrays (Python); Sample exam Q21b (5 marks): Python: subroutines, lists, loops; 2025 HSC Q26 (5 marks): Design, construct and implement a solution (Python)

Memorise: Data structures

List Term Programming Fundamentals (Year 11)

An ordered, changeable collection of items (Python list) that can grow and shrink and can hold mixed types.

Example: 'scores = [3, 5]; scores.append(8)'

Where you would use it in the test
  • Python: append, index, loop
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Related past questions: 2025 HSC Q26 (5 marks): Design, construct and implement a solution (Python); Sample exam Q21b (5 marks): Python: subroutines, lists, loops

Memorise: Data structures

Hash table Term Programming Fundamentals (Year 11)

A structure that stores key and value pairs, using a hash function on the key to find the storage location, so lookups are very fast (a Python dictionary).

Example: 'Fast lookup: ages["Sam"].'

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Python: Python question: write or complete it in the online Python tool.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.

Memorise: Data structures

Sequential file Term Programming Fundamentals (Year 11)

A file of data stored and read one item or line after another, such as a text or CSV file.

Example: 'Open, read line by line, close.'

Where you would use it in the test
  • Python: read and write files
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Memorise: Data structures

Syntax error Term Programming Fundamentals (Year 11)

A mistake that breaks the language rules (missing colon, bracket or misspelt keyword), so the program will not run.

Example: 'print("hi" with no closing bracket.'

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Python: Spot and fix the error
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.

Related past questions: 2025 HSC Q15b (3 marks): Testing and debugging

Memorise: Testing and code quality (Year 11)

Debugging output statements Term Programming Fundamentals (Year 11)

Print statements added to show that a section was reached or the value of a variable.

Example: 'print("total =", total)'

Where you would use it in the test
  • Short answer: Name one software debugging tool
  • Python: Python question: write or complete it in the online Python tool.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.

Related past questions: 2025 HSC Q15b (3 marks): Testing and debugging

Memorise: Testing and code quality (Year 11)

Class Term The Object-Oriented Paradigm (Year 11)

A blueprint or template that defines the attributes and methods shared by all objects of one kind.

Example: 'class Student:' defines the template; each student is an object.

Where you would use it in the test
  • Drawing: class diagram box (name, attributes, methods)
  • Python: class definition
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.

Related past questions: 2025 HSC Q22 (3 marks): Modelling tools; Sample exam Q24 (4 marks): Modelling tools (class diagram)

Memorise: Object-oriented concepts

Object Term The Object-Oriented Paradigm (Year 11)

A single instance of a class with its own attribute values and the ability to run the class's methods.

Example: 's1 = Student("Ava")' creates an object.

Where you would use it in the test
  • Python: create an object
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q22 (3 marks): Modelling tools

Memorise: Object-oriented concepts

Attribute Term The Object-Oriented Paradigm (Year 11)

A variable that belongs to an object and stores its data or state (name, age, balance).

Example: 'self.balance = 0' stores an attribute.

Where you would use it in the test
  • Drawing: middle section of the class box
  • Python: Python question: write or complete it in the online Python tool.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.

Related past questions: 2025 HSC Q22 (3 marks): Modelling tools; Sample exam Q24 (4 marks): Modelling tools (class diagram)

Memorise: Object-oriented concepts

Method Term The Object-Oriented Paradigm (Year 11)

A subroutine that belongs to a class and defines what its objects can do (deposit, display, calculate).

Example: 'def deposit(self, amount):' is a method.

Where you would use it in the test
  • Drawing: bottom section of the class box
  • Python: Python question: write or complete it in the online Python tool.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.

Related past questions: 2025 HSC Q22 (3 marks): Modelling tools; Sample exam Q24 (4 marks): Modelling tools (class diagram)

Memorise: Object-oriented concepts

Constructor (__init__) Term The Object-Oriented Paradigm (Year 11)

A special method that runs when an object is created and sets its starting attribute values (in Python it is __init__).

Example: 'def __init__(self, name): self.name = name'

Where you would use it in the test
  • Python: Write a class with __init__
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Memorise: Object-oriented concepts

Check this one: The syllabus says implement OOP code but does not name constructors; Python classes need __init__ so it is a safe code-pattern card.

Inheritance Term The Object-Oriented Paradigm (Year 11)

A subclass (child) automatically gets the attributes and methods of a superclass (parent) and can add or change its own, giving code reuse. It models an 'is-a' relationship.

Example: 'Student inherits name and age from Person; the arrow points from Student to Person.'

Where you would use it in the test
  • Drawing: inheritance arrow on a class diagram
  • Python: class Child(Parent)
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.

Related past questions: 2025 HSC Q22 (3 marks): Modelling tools; Sample exam Q24 (4 marks): Modelling tools (class diagram)

Memorise: Object-oriented concepts

Superclass and subclass Term The Object-Oriented Paradigm (Year 11)

A superclass is the parent class that supplies shared features; a subclass is a child class that inherits them and adds its own.

Example: 'Dog is a subclass of Animal.'

Where you would use it in the test
  • Drawing: class diagram
  • Python: class Child(Parent)
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.

Related past questions: 2025 HSC Q22 (3 marks): Modelling tools; Sample exam Q24 (4 marks): Modelling tools (class diagram)

Memorise: Object-oriented concepts

Polymorphism Term The Object-Oriented Paradigm (Year 11)

Different classes provide their own version of the same method name, so one call behaves differently depending on the object.

Example: 'speak() prints Woof for Dog and Meow for Cat.'

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Python: override a method
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.

Memorise: Object-oriented concepts

Method overriding Term The Object-Oriented Paradigm (Year 11)

A subclass supplies its own version of a method it inherited, replacing the parent's version; the way polymorphism is coded.

Example: 'Cat.speak() overrides Animal.speak().'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Memorise: Object-oriented concepts

Check this one: Not named in the syllabus; it is how polymorphism is shown in Python code.

Code commenting Term The Object-Oriented Paradigm (Year 11)

Short explanations in the code that say what it does and why, so other developers and your future self can understand and maintain it.

Example: '# calculate GST for each item'

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Multi-select: Multi-select: you tick every correct option, so know all its features or goals.
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: Sample exam Q4 (1 mark): Collaboration

Memorise: Object-oriented concepts

Clear and uncluttered mainline Term The Object-Oriented Paradigm (Year 11)

A mainline that only calls well-named subroutines or methods in order, so the overall flow is easy to follow.

Example: Keep the mainline to a few calls; put detail in subroutines.

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Multi-select: Multi-select: you tick every correct option, so know all its features or goals.
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: Sample exam Q14 (3 marks): Algorithm design (subroutines)

Memorise: Testing and code quality (Year 11)

One logical task per subroutine Term The Object-Oriented Paradigm (Year 11)

Each subroutine does a single clear job, which makes it reusable, testable and easier to fix.

Example: 'calculateTotal() only calculates; displayTotal() only displays.'

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: Sample exam Q14 (3 marks): Algorithm design (subroutines); Sample exam Q21b (5 marks): Python: subroutines, lists, loops

Memorise: Testing and code quality (Year 11)

Defensive data input handling Term Secure Software Architecture (Year 12)

Writing code that assumes input may be wrong or hostile and handles it safely using input validation, sanitisation and error handling.

Example: 'Reject non-numeric age, then ask again.'

Input validation Term Secure Software Architecture (Year 12)

Checking that input meets rules (type, range, length, format, presence) before it is used.

Example: 'if not age.isdigit(): reject'

Where you would use it in the test
  • Python: Python validation function
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.

Related past questions: Sample exam Q18b (3 marks): Developing secure code (Python input validation); Familiarisation Q9b (3 marks): Developing secure code (Python input validation); 2025 HSC Q19 (3 marks): Developing secure code (Python)

Memorise: Defensive data input handling: validation, sanitisation, error handling

Error handling Term Secure Software Architecture (Year 12)

Detecting and managing problems (try and except in Python) so the program fails safely, shows a generic message and does not leak internal details.

Example: 'try: int(x) except ValueError: print("Enter a number")'

Where you would use it in the test
  • Python: try / except
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Related past questions: 2025 HSC Q19 (3 marks): Developing secure code (Python); Sample exam Q18b (3 marks): Developing secure code (Python input validation)

Memorise: Defensive data input handling: validation, sanitisation, error handling

Exception management Term Secure Software Architecture (Year 12)

Handling runtime exceptions (try and except) so a failure is caught, logged and recovered from instead of crashing the program.

Example: 'Catch FileNotFoundError and show a message.'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Memorise: Defensive data input handling: validation, sanitisation, error handling

Neural network Term Software Automation (Year 12)

A model made of connected layers of nodes (neurons): an input layer, one or more hidden layers and an output layer; connection weights are adjusted during training.

Example: 2025 Q25: a neural network is one technique within AI.

Where you would use it in the test
  • Short answer: Distinguish a neural network from AI (2025 Q25)
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: 2025 HSC Q25 (5 marks): Patterns in human behaviour; neural networks (virtual personal assistant)

Memorise: Decision trees

Linear regression Term Software Automation (Year 12)

Fits a straight line through data to predict a numeric value from one or more inputs.

Example: 'Predict house price from floor area.'

Where you would use it in the test
  • Short answer: Compare linear regression and KNN (sample Q23b)
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: Sample exam Q23b (3 marks): Linear regression v K-nearest neighbour

Memorise: Decision trees

Polynomial regression Term Software Automation (Year 12)

Fits a curve (a polynomial) to data where the relationship is not a straight line, to predict a numeric value.

Example: 'Predict plant growth that speeds up then slows down.'

Where you would use it in the test
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Python: Python question: write or complete it in the online Python tool.

Memorise: Decision trees

Logistic regression Term Software Automation (Year 12)

Predicts the probability of a category (yes or no) and so is used for classification, not for predicting a number.

Example: 'Predict whether an email is spam.'

Where you would use it in the test
  • Multiple choice: 2025 Q12: true or false statements
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: 2025 HSC Q12 (2 marks): Logistic regression

Memorise: Decision trees

OOP for ML programming Code pattern Software Automation (Year 12)

ML models are written as classes: attributes hold data and weights, methods train, predict and evaluate.

Example: 'model = LinearRegression(); model.fit(x, y); model.predict([[5]])'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.

Memorise: Decision trees

Neural network code (predict) Code pattern Software Automation (Year 12)

Create the model object, train (fit) on training data, then call predict on new data to make predictions.

Example: 'net.fit(X, y); net.predict(new)'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Memorise: Decision trees

Nested IF Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

An IF inside the ELSE of another IF to test several conditions where only one process runs.

Example: 'IF a THEN ... ELSE IF b THEN ... ELSE ... ENDIF ENDIF'

Where you would use it in the test
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design

Memorise: Python and SQL you must be able to write

WHILE loop (pre-test) Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

WHILE condition is true ... ENDWHILE: the condition is tested before each loop, so the body may never run.

Example: 'WHILE count < 5 ... ENDWHILE'

Where you would use it in the test
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Python: Python while

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design; Sample exam Q9 (2 marks): Algorithm design (guessing game)

Memorise: Python and SQL you must be able to write

FOR / NEXT loop (counted) Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

FOR variable = start TO finish STEP increment ... NEXT variable; used when the number of repeats is known.

Example: 'FOR i = 1 TO 5 ... NEXT i'

Where you would use it in the test
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design

Memorise: Python and SQL you must be able to write

Check this one: Not found word-for-word in the supplied syllabus, specifications, marking guidelines or notes; the definition is standard computing knowledge, so check it against your class notes.

Subroutine and function (pseudocode) Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

BEGIN name (parameters) ... END name. A function returns a single value with RETURN.

Example: 'BEGIN Add (x, y) total = x + y RETURN total END Add'

Where you would use it in the test
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: Sample exam Q14 (3 marks): Algorithm design (subroutines)

Memorise: Python and SQL you must be able to write

Array sum pattern Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

Set total to 0, loop through every item adding it to the total, then display the total (initialise, loop, accumulate, output).

Example: 'total = 0; FOR each item: total = total + item'

Where you would use it in the test
  • Pseudocode: Write algorithm (2025 Q17)
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design

Memorise: Python and SQL you must be able to write

Check this one: A coding pattern from the exam solution style, not a syllabus term.

Linear search pattern Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

Check each item in order until found or the end is reached; set a Found flag, loop through and stop on a match.

Example: 'found = False; for i in list: if i == target: found = True'

Where you would use it in the test
  • Pseudocode: Linear search (familiarisation Q8)
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: Familiarisation Q8 (3 marks): Algorithm design (linear search)

Memorise: Python and SQL you must be able to write

Python input and output Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

input() reads text from the user as a string; print() displays output; convert with int() or float().

Example: 'age = int(input("Age: "))'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q19 (3 marks): Developing secure code (Python); Sample exam Q18b (3 marks): Developing secure code (Python input validation)

Memorise: Python basics: input, selection, loops, strings

Python selection (if elif else) Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

if condition: ... elif condition: ... else: ...; indentation matters (Q19 marker note: indentation).

Example: 'if mark >= 50: print("Pass") else: print("Fail")'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q19 (3 marks): Developing secure code (Python)

Memorise: Python basics: input, selection, loops, strings

Python for loop and range Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

for i in range(start, stop): repeats; stop is exclusive; also loops over lists and strings.

Example: 'for i in range(1, 6): print(i)'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q26 (5 marks): Design, construct and implement a solution (Python)

Memorise: Python basics: input, selection, loops, strings

Python while loop Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

while condition: ... repeats while True; make sure the condition changes.

Example: 'while guess != answer: guess = int(input())'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: Sample exam Q9 (2 marks): Algorithm design (guessing game)

Memorise: Python basics: input, selection, loops, strings

Python strings and slicing Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

Strings are sequences: len(s), s[0], s[-1], s[1:4], s.upper(), s.lower(), s.split(), s.strip(), and ord()/chr() for character codes.

Example: 'word[0] is the first letter; word[-1] is the last.'

Where you would use it in the test
  • Python: String processing (2025 Q19)
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q19 (3 marks): Developing secure code (Python)

Memorise: Python basics: input, selection, loops, strings

Python lists Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

A list stores ordered items: append(), remove(), len(), sorting with sort(), looping, and 2D lists as a list of lists.

Example: 'grid = [[0]*3 for _ in range(3)]'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q26 (5 marks): Design, construct and implement a solution (Python); Familiarisation Q13 (6 marks): Python: lists, loops, selection; Sample exam Q21b (5 marks): Python: subroutines, lists, loops

Memorise: Python basics: input, selection, loops, strings

Python 2D list (grid) Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

A list of lists addressed as grid[row][column]; loop with nested for loops.

Example: 'grid[1][2] = 5'

Where you would use it in the test
  • Python: Grid (2025 Q26, sample Q21)
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q26 (5 marks): Design, construct and implement a solution (Python); Sample exam Q21a (1 mark): 2D arrays (Python); Sample exam Q21b (5 marks): Python: subroutines, lists, loops

Memorise: Python basics: input, selection, loops, strings

Python random numbers Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

import random then random.randint(a, b) gives a whole number a to b inclusive; use a set or a check to avoid repeats.

Example: 'n = random.randint(1, 50)'

Where you would use it in the test
  • Python: 2025 Q26 random grid
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q26 (5 marks): Design, construct and implement a solution (Python)

Memorise: Python basics: input, selection, loops, strings

Check this one: Library use is allowed under 'modules and libraries'; random.randint is a standard Python function.

Python functions Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

def name(parameters): ... return value. Functions must be defined before they are called (2025 Q19 marker note: call functions after definition).

Example: 'def area(w, h): return w * h'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q19 (3 marks): Developing secure code (Python)

Memorise: Python basics: input, selection, loops, strings

Global and local variables Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

A local variable exists only inside its function; a global variable is declared outside and can be used throughout (use the global keyword to change it inside a function).

Example: 'count = 0 (global); def add(): global count'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Memorise: Python basics: input, selection, loops, strings

Python file handling Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

open(filename, mode) with modes r (read), w (write, overwrites), a (append); use with to close the file automatically; read(), readline(), write().

Example: 'with open("data.txt") as f: lines = f.readlines()'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Memorise: Python basics: input, selection, loops, strings

Python modules and libraries Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

import a module to use its functions: import random, import math, from sklearn.linear_model import LinearRegression.

Example: 'import math'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Memorise: Python basics: input, selection, loops, strings

Python classes and objects Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

class Name: with __init__(self, ...) to set attributes; methods have self; create objects with Name(...); inheritance with class Child(Parent):.

Example: 'class Dog(Animal): def speak(self): return "Woof"'

Where you would use it in the test
  • Python: Write a class
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q22 (3 marks): Modelling tools

Memorise: Python basics: input, selection, loops, strings

Python validation function pattern Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

Loop until the input is valid, using try/except for the conversion and if for range checks.

Example: 'while True: try: n = int(input()) ... except ValueError: ...'

Python try / except Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

try: risky code except ValueError: handle the error; keeps the program running with a helpful message.

Example: 'except ValueError: print("Numbers only")'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: Sample exam Q18b (3 marks): Developing secure code (Python input validation)

Memorise: Python basics: input, selection, loops, strings

Python sqlite3 parameterised query Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

Use ? placeholders and pass values separately, never join user text into the SQL string, to stop SQL injection.

Example: 'cur.execute("SELECT * FROM user WHERE name = ?", (name,))'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.

Memorise: Python basics: input, selection, loops, strings

Check this one: Parameterised queries are standard secure practice (defensive input handling); the syllabus does not name sqlite3.

Python file and ML code reading (scikit-learn) Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

Know how to read: import, create the model, fit (train), predict.

Example: 'model.fit(x, y); model.predict([[4]])'

Where you would use it in the test
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Python: Python question: write or complete it in the online Python tool.

Memorise: Python basics: input, selection, loops, strings

Construct Command word Command Words and Question-type Skills

Make; build; put together items or arguments.

Example: 'Construct a SQL query.' Answer: build the diagram, query or code with every required feature.

Where you would use it in the test
  • Drawing: Drawing question: draw or label it in the online drawing tool.
  • Python: Python question: write or complete it in the online Python tool.
  • SQL: SQL question: write or read it in the SQL query tool.
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; 2025 HSC Q22 (3 marks): Modelling tools

Memorise: NESA key verbs: what each one asks for

Apply Command word Command Words and Question-type Skills

Use, utilise or employ in a particular situation.

Example: 'Apply input validation to this code.' Answer: use the idea on the given scenario.

Where you would use it in the test
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.
  • Python: Python question: write or complete it in the online Python tool.

Memorise: NESA key verbs: what each one asks for

Demonstrate Command word Command Words and Question-type Skills

Show by example.

Example: 'Demonstrate how it works.'

Where you would use it in the test
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.
  • Python: Python question: write or complete it in the online Python tool.

Memorise: NESA key verbs: what each one asks for

Python questions Process Command Words and Question-type Skills

Write code that runs: indentation, quotes, define functions before calling them, print the required output, meet every listed requirement.

Example: 2025 Q19 and Q26.

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: 2025 HSC Q19 (3 marks): Developing secure code (Python); 2025 HSC Q26 (5 marks): Design, construct and implement a solution (Python)

Memorise: Exam day facts, key verbs and technique