← ACARA Digital Technologies Years 7–8 — Programming with Control Structures and Functions (Python)

ACARA Digital Technologies Years 7–8 — Programming with Control Structures and Functions (Python) Hangman

Years 7–8 · Australian Curriculum · 45 key terms.

Theme
Words

Every word, shuffled.

Players

Writing, changing and fixing Python programs with decisions, loops and functions. 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.

CrosswordTracing and Debugging Algorithms and Programming with Control Structures and Functions (Python) · Programming with Control Structures and Functions (Python) and Programming with Control Structures and Functions (JavaScript) · Searching and sorting algorithms and Errors and debugging · all 15

Word searchAlgorithms, Flowcharts and Pseudocode to Programming with Control Structures and Functions (Python) · Programming with Control Structures and Functions (Python) and Programming with Control Structures and Functions (JavaScript) · Object-oriented programming to Errors and debugging · all 13

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 45 key terms

1program
A text file of Python instructions. You write it in the editor, and when you press Run, Python does each line in order from first to last and shows the output in the output panel.
2print("Hi")
One typed line of Python matches one Scratch block. A stack of blocks becomes lines of code that run in order from the top, so spelling and punctuation must be exact.
4print("Hello!")
Python version of the Scratch say block. It shows the text inside the quotes on screen, so say Hello! becomes print("Hello!"). Python has no direct match for say for 2 seconds.
5syntax error
An error that occurs when Python cannot understand your code due to a typo, missing quote, or wrong bracket; Python stops and shows a message with the line number
7sequence
A control structure where statements run one after another, top to bottom, so changing their order can change the result.
10score = score + 1
Python for the Scratch block 'change score by 1'. Python works out the right side first, then stores the answer back in score. Use score = 0 to set it.
15name = input("What is your name? ")
Like Scratch ask and wait: input() shows the prompt, waits for a reply, and the answer is stored in a variable (name), just like the answer reporter.
17TypeError
A runtime error when an operation gets the wrong data types, like '5' + 3 (string plus integer). Fix it by converting with int() or str(), e.g. int(input()).
21Traceback (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.
22NameError
An error Python raises when code uses a variable or function name it does not know, often from a typo, wrong capitals, missing quotes or using a name before it is assigned.
28if score == 10:
Python's version of Scratch's if block: the hexagon condition becomes a comparison like ==, then a colon, and the blocks inside become indented lines. Add else: for the else part.
30nested if
An if statement indented inside another if block. The inner condition is only checked when the outer condition is True.
31IndentationError
Python errors when a block's lines are not indented consistently, or when the if, for, while or def line that opens the block is missing its colon.
34for i in range(10):
Python's version of the Scratch repeat 10 block. The lines indented under it run 10 times, and i counts from 0 to 9.
35count += 1
Set count = 0 before a loop, then use count += 1 inside it to add 1 each repeat. Use total += value to build a running total.
37while True:
The Python version of the Scratch forever block. It repeats its indented code nonstop until break. Scratch repeat until x becomes while not x:
39if inside a loop
An if indented inside a loop's block is checked again on every repetition, so each pass can make a different decision.
40for vs while
Use for when you know how many times to repeat, like 10 times. Use while when repeating depends on a condition that can change, like until the user types quit.
41Nested FOR loop
A FOR loop placed entirely inside another FOR loop, so the inner loop runs fully for every repetition of the outer loop
42while not valid:
A loop that keeps asking for input again until the answer is valid, so bad data (like an age of -5) can't get into your program. Show an error message each time.
43infinite loop
A while loop whose condition never becomes False, often because the loop variable is never updated. Stop it with the Stop button, or fix it by changing the variable inside the loop.
44def
Makes a Python function, like defining a Scratch My Block once. Run it any time by calling its name, e.g. greet(). Inputs become parameters, so you reuse the code instead of copying blocks.
48return
Hands a value back to the caller so it can be stored in a variable or used in a calculation. print() inside a function only shows the value on screen, and the function then gives back None.
49procedure 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.
50if is_even(n):
Calls a function that returns True or False right inside an if condition. The indented code runs only when the function returns True, so no extra variable is needed.
53def main():
A function that calls other small functions, each doing one job, so the program is built in parts. Each box in a hierarchy chart can become one function.
55snake_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.
56"""docstring"""
A triple-quoted string placed first in a function or class that describes its purpose, parameters and return value. It is internal documentation.
57score <- 0 becomes score = 0
Pseudocode steps map to Python lines: <- becomes =, input becomes input(), if becomes if with a colon, for becomes for in range(). END IF becomes un-indenting.
58if / while
A flowchart diamond (a decision) becomes if, or while when an arrow loops back to it. Rectangles become statements and parallelograms become input() or print().
59Trace table
A table that records the value of each variable at every step of an algorithm, used to check its logic by hand.
60nested loop
A loop inside another loop. When tracing, the inner loop completes all its repeats for each single repeat of the outer loop, so total passes = outer repeats x inner repeats.
61runtime error
An error that stops a program while it runs, shown as a named error like NameError, ValueError or ZeroDivisionError. Read the message to find the problem.
62ZeroDivisionError
A Python runtime error raised when a number is divided by 0, or a remainder is taken with % 0. Guard against it with an if check or try/except.
63logic error
A mistake that lets a program run with no error message but give the wrong result, caused by a wrong condition, operator (> or >=), range() off by one, or steps in the wrong order.
64print("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.
65# (commenting out)
Putting # in front of a line, or a selected block, stops Python running it. Use this to isolate a bug, then remove the # to restore the code.
66breakpoint
A marker set on a line of code that pauses the program there when it runs, so you can inspect variables and step through. Set one by clicking beside the line; click again to remove it.
67step over
Run the next line only, then pause again. Check the variable watch panel after each step to see which line first gives a wrong value.
68modify 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.
69test 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.
70Boundary values
Test inputs at the edge of a condition. For age >= 18, test 17 (just below), 18 (exactly on) and 19 (just above) to check the algorithm picks the right path at the edge.
72import random
Gives your program the random module. Then random.randint(1, 6) gives a random whole number from 1 to 6, and random.choice(my_list) picks a random item from a list.
73while guess != secret:
The loop at the heart of a guessing game. It keeps asking until the guess matches the random secret number. If/elif/else gives hints and a counter adds 1 each turn.
74if ask(q, a): score += 1
Calls a function that returns True for a right answer, then adds 1 to score when it does. Put this in a loop to ask every question and total the quiz score.

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.

More Australian Curriculum Hangman

ACARA Digital Technologies Years 5–6 — Inside Digital Systems18 key terms ACARA Digital Technologies Years 5–6 — Networks and Sharing Data25 key terms ACARA Digital Technologies Years 5–6 — Representing Data with Numbers36 key terms ACARA Digital Technologies Years 5–6 — Algorithms with Branching and Repetition40 key terms ACARA Digital Technologies Years 5–6 — Staying Safe Online38 key terms ACARA Digital Technologies Years 5–6 — Digital Footprints55 key terms Make your own hangman →Paste any word list and play