← 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 · 71 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 journey, on the board

Two answers, the class points left or right and you reveal why. The journey’s own questions, no devices.

▶ Run Duo on the board

Same words, on paper

The quiet activity after the loud one. Free to print, answer keys included.

Add your class once in the Random Name Picker Wheel — it works here and in the Random Team Generator.

When your class is on devices

Sprint: a fast whole-class game on any module, where every student plays at their own level. Same modules, with a free class.

The 71 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.
3print
Will display text to console.
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
6comments
# is used to explain code - Python ignores text after the #
7sequence
A control structure where statements run one after another, top to bottom, so changing their order can change the result.
8variables
Variables store values using = (assignment operator)
9data types
Strings are text in quotes.
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.
11arithmetic
+ adds two numbers together.
12using imports (random, time, etc.)
Keyword that loads a module so you can use its functions.
14input
Pauses program and waits for user to press Enter key.
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.
16f-strings
Assigns the string Alice to the variable name.
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()).
18concatenation
Concatenation joins strings with + but no space is added.
19type conversion
Converts the string "5" to the integer 5.
20len()
len() counts characters - len("Hello") gives 5.
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.
23comparison operators (>, <, ==, !=, >=, <=)
Greater than - checks if the left value is larger than the right.
24boolean logic (true/false, and, or, not)
A data type with only two values: True or False.
26if statements
Runs the indented code only when the condition is True.
27else statements
Catch-all block that runs when all if/elif conditions are False. else never has a condition - just else: with a colon.
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.
29elif statements
Short for 'else if' - checks another condition if the previous was False.
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.
32for loops
Loop that iterates through each item in a sequence.
33range()
Creates numbers from 0 up to but not including stop.
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.
36while loops
Repeats indented code as long as the condition is True.
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:
38break and continue
Immediately exits the entire loop.
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.
45functions - defining
Keyword that creates (defines) a new function.
46functions - parameters
A variable name in the function definition that receives data.
47functions - return values
Sends a value back to the code that called the function.
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.
51functions - default arguments
A pre-set value used when no argument is provided.
52functions - scope
Where a variable can be accessed - local or global.
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.
71more arithmetic operators (//, %, **)
Floor division - divides and rounds DOWN to the nearest integer.
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, nothing to install. If you add your class names, they are saved in your own browser and sent to Cloodit only if you choose to save the class.

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 once, here, on a Hangman topic page or in the Random Name Picker Wheel, and a random student is called for each word. The class 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