ACARA Digital Technologies Years 9–10 — Modular and Object-Oriented Programming (Python) Hangman
Years 9–10 · Australian Curriculum · 33 key terms.
Every word, shuffled.
The names stay in this browser on this computer — they are never sent to Cloodit. A random student is called for each word.
Writing Python programs in reusable pieces, including with classes and objects. See the whole journey →
Want your own words? Free Hangman Generator →
Same words, on paper
The quiet activity after the loud one. Free to print, answer keys included.
CrosswordModular and Object-Oriented Programming (Python) · Errors and debugging and Testing modules · Searching and sorting algorithms and Errors and debugging · all 13
Word searchModular and Object-Oriented Programming (Python) and Modular and Object-Oriented Programming (JavaScript) · Errors and debugging to Artificial intelligence in programming · Efficient and effective solutions and user-centred design to Code repositories, APIs, libraries and AI assistants · all 9
Worksheetfor any module, with answer key
When your class is on devices — Snake Break and Diamond Dash run on the same modules, with a free class.
The 33 key terms
- 4procedure vs function
- A procedure carries out a task without returning a value, while a function returns a value to the code that called it, so the result can be stored or used.
- 6if is_even(n):
- Calls a function that returns True or False and uses that result directly as the if condition. You do not need to write == True. It can also be combined with not, and, or.
- 9snake_case
- A naming style where all letters are lowercase and words are joined by underscores, like student_score. Python uses it for variables and functions, and it should be used consistently.
- 10"""docstring"""
- A triple-quoted string placed first in a function or class that describes its purpose, parameters and return value. It is internal documentation.
- 11def main(): greet()
- A function can call another function inside its body. Big problems get split into small helper functions that each do one job, like boxes in a decomposition.
- 12refactoring
- Rewriting working code to make it clearer or simpler (e.g. renaming variables, moving repeated lines into a function) without changing what it does, then re-running tests.
- 13hierarchy chart
- A diagram that splits one main problem into smaller sub-problems in boxes, level by level, until each box is a small task that can be solved on its own.
- 14def main():
- Defines a function called main that holds the main steps of your program. You call main() once at the end of the file, after the other functions are defined, to start the program.
- 24sum(), min(), max()
- Built-in functions that return the total, smallest and largest value in a list, replacing a hand-written loop with one short, clear line of code.
- 25def total_of(scores):
- A function header with a list parameter. Pass a list when you call it, like total_of([5, 8, 9]), and the function can loop over or read its items.
- 26copy = items[:]
- A function can change a list you pass in, altering the original in place. Make a copy with [:] first if you need to keep the original list unchanged.
- 27result = []
- Start a function with an empty list, append each wanted item inside a loop, then return the finished list after the loop ends. Filtering builds a new list.
- 31Traceback (most recent call last):
- The start of Python's error report. It names the error type (like NameError) and the line number where it happened, so you know where to start looking for the bug.
- 32IndexError
- A runtime error raised when code uses an index that is not in the list, such as items[5] in a 5-item list. The last valid index is len(items) - 1.
- 33print("total =", total)
- A debug print. Add a line like this to show a variable's value while the program runs, so you can spot where it goes wrong. Put one inside a loop to watch it change, then remove it once fixed.
- 34breakpoint
- A marker set on a line of code (click beside the line number) that pauses the program there in debug mode, so you can inspect variables and step through the code.
- 35step through
- Run paused code one line at a time using step over, step into or step out, while the watch panel shows each variable change, to find where a value goes wrong.
- 36return
- Sends a value back to the caller. If a function only prints and has no return, it gives back None, so the caller cannot use the result.
- 37modify code
- Read a working program, then change one part, like a value, condition or message, to get new behaviour. Predict the result first, change one thing at a time, then run it.
- 38test case
- A chosen input paired with the output you expect. Run the program with it, compare the real output to the expected result in your test table, then record pass or fail.
- 39assert
- Checks a condition is True, like assert add(2, 3) == 5. If the result is not what you expected, it raises an AssertionError, so test cases can run automatically.
- 40unit testing
- Testing one function or class on its own, with its own test table, before joining it to the rest of the program, so a failing test points to that module.
- 41object-oriented programming
- A way of writing programs that groups related data and the code that uses it into one unit called an object, so programs modelling real things are easier to organise than separate lists and functions.
- 42class diagram
- A box listing a class's name, attributes and methods. An arrow joins a child class to the parent it inherits from. You draw it as a plan before writing the code.
- 45object.attribute
- Dot notation reads or changes an attribute stored in an object, like print(pet.name) or pet.age = 5. Each object keeps its own values. A missing attribute causes an AttributeError.
- 47def deposit(self, amount):
- A method can take extra parameters after self, like amount, and use return to send a value back to the code that called it.
- 49s2 = Student('Liam')
- Creates a second object from the same class. Each object keeps its own attribute values, so changing s2 does not change s1, but both use the same methods.
- 51objects.append(obj)
- Adds an object to the end of a list so many objects are stored together. You can then loop over the list with a for loop to call each object's methods or find one by its attribute.
- 53encapsulation
- Bundling an object's data and the methods that use it into one class, and controlling access so the data is only changed in safe ways through those methods.
- 55def set_balance(self, amount):
- A setter method that changes a private attribute only after checking the new value is valid, such as rejecting a negative amount, so the object never holds bad data.
- 57self.name = name
- Saves a value on the object. Without self. the attribute is lost (AttributeError), and a method missing self as first parameter gives a TypeError for wrong argument count.
- 58assert obj.method() == expected
- Creates an object, calls its method, then uses assert to check the result or attribute equals what you expect. If it is False, Python raises an AssertionError.
- 59modular program
- A program split into parts: a class for its things, a list of objects, and small functions called from main(), planned with diagrams and checked with tests.
Frequently Asked Questions
Do I need an account?
No. Hangman runs straight from this page — no account, no sign-up, nothing to install. If you add your class names, they are saved in your own browser and never sent to Cloodit.
How do I play it with my class?
Put the page on your whiteboard or projector and press Play. The class calls out letters and you click or type them. Six wrong letters and the word gets away. After every word its definition appears, so each round ends on the meaning, not just the spelling.
Can I use my own words?
Yes. The free Hangman generator at cloodit.com/hangman/ takes any list: one word or phrase per line, with a definition after a dash if you want it shown at the end of the round.
Can I put my students' names in?
Yes. Add your class list and a random student is called for each word. The list stays in this browser on this computer, so it is still there next lesson.
Are the worksheets free too?
Yes. Every module in this journey has a free printable worksheet with a full answer key, and there are crosswords and word searches built from the same key terms.