WA Computer Science ATAR Year 11 — Control Structures and Data Types Hangman
Year 11 · WA ATAR · 65 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.
The building blocks every program is made from. 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.
CrosswordData sources and files to Graphical user interfaces · Graphical user interfaces and Object-oriented programming · if-then-else block to Reading and tracing complex pseudocode · all 24
Word searchData sources and files to Object-oriented programming · What is Pseudocode to Reading and tracing complex pseudocode · Errors and debugging to Artificial intelligence in programming · all 17
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 65 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.
- 4sequence
- A control structure where statements run one after another, top to bottom, so changing their order can change the result.
- 7GST_RATE = 0.1
- A constant: a named value set once and never changed while the program runs. Written in UPPER_CASE by convention, it replaces magic numbers and is easy to update in one place.
- 10int(input())
- input() always returns a str, so convert it (e.g. with int) to store it as a number. Turn it back into text with str() or an f-string when you output it.
- 22MOD
- The pseudocode operator that returns the remainder after integer division. Example: 10 MOD 3 gives 1 because 10 divided by 3 is 3 remainder 1
- 24AND
- A VCAA pseudocode boolean operator that combines two conditions. The overall result is true only when BOTH conditions are true. Example: x > 0 AND x < 10
- 29nested if
- An if statement indented inside another if block. The inner condition is only checked when the outer condition is True.
- 34for 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.
- 35infinite 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.
- 36Nested FOR loop
- A FOR loop placed entirely inside another FOR loop, so the inner loop runs fully for every repetition of the outer loop
- 41input
- A VCAA pseudocode keyword that accepts a value from the user and stores it in a named variable. Example: input age stores the user's entered value in the variable age
- 42print
- A VCAA pseudocode keyword that outputs a value, variable or expression as a result. Example: print area displays the current value stored in the variable area
- 43IF-THEN-ELSE
- A selection structure that runs one set of instructions if a condition is true, and a different set if it is false
- 44ELSE IF
- A keyword that adds another condition to check if the previous IF or ELSE IF condition was false
- 45FOR i FROM 1 TO n
- A loop that repeats its instructions a fixed number of times, counting the variable i from 1 up to n
- 46WHILE condition DO
- A loop that repeats its instructions for as long as the given condition remains true, checked before each repetition
- 47REPEAT ... UNTIL condition
- A loop that repeats its instructions and checks the condition after each repetition, so the body always runs at least once
- 48count <- count + 1
- A counter. It adds 1 to a variable each time a loop repeats. Set it to 0 before the loop. An accumulator works the same way: total <- total + x adds a value each time.
- 53for item in my_list:
- Runs the indented block once for each value in the list. The variable item holds the current value each time round, starting with the first and finishing with the last.
- 54for i in range(len(arr)):
- Loops i through every index of arr, so arr[i] can be read or changed and you know each element's position. Used for totals, finding the largest value and editing in place.
- 55scores = [0] * 10
- Creates a one-dimensional array (list) of 10 elements that all start with the value 0. Change the number to set the size, or use '' for strings.
- 56scores[1]
- Accesses the array element at index 1, using square brackets to specify the position.
- 62list, dict, tuple
- Pick the structure by how you use the data: a list for an ordered collection, a dict for lookup by key, and a tuple for a fixed group of values that should not change.
- 63syntax 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
- 64IndentationError
- 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.
- 65runtime 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.
- 66Traceback (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.
- 67NameError
- 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.
- 68TypeError
- 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()).
- 69ZeroDivisionError
- 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.
- 70IndexError
- 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.
- 72logic error
- A mistake in an algorithm's steps. It still runs to the end with no warning, but gives the wrong output. Only tracing or testing shows it, unlike a syntax error that breaks the writing rules.
- 73off-by-one error
- A bug where a repeat count or stop test is wrong by one, such as count > 5 instead of count = 5, so the loop body runs one time too many or one time too few.
- 74follow an algorithm
- To carry out each step exactly as written, in order, without skipping steps or guessing. You can track values on paper, check the final result, or act it out with a partner.
- 75trace an if
- Check the condition using the current values, record TRUE or FALSE in the trace table, then follow only the branch that is true and skip the other branch.
- 76trace table
- A table with one row per loop repeat. Record the IF condition result, change only the variables the branch updates, copy the rest down, and note any output.
- 77print(variable)
- Debugging tool: print a variable at key points, then compare each value with your trace table of what it should be. The first mismatch shows where the bug is.
- 78# (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.
- 79breakpoint
- 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.
- 80step 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.
- 81normal, boundary and invalid data
- A good test set uses normal data (typical values), boundary data (values at the edges of a range) and invalid data (values that should be rejected), so every path in an algorithm is checked.
- 82test table
- A table with one row per test case. Its columns are test number, purpose, input, expected result, actual result and pass or fail.
- 83test 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.
- 84assert
- 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.
- 85test coverage
- Testing so that every if/elif/else branch runs at least once and every loop is tried running zero times, once and many times. Any code never run is untested.
- 86modify code
- Read and trace the code first to see what it does, then change one small part at a time and re-run your test cases to check the effect of that change.
- 87validation vs verification
- Validation checks entered data is reasonable and complete. Verification checks it matches the source data, for example by proofreading.
- 88validation
- An automatic check that data is reasonable and in the right form when entered. It blocks bad data early, but it cannot prove the data is true (a valid age of 15 could still be wrong).
- 89validation check
- A test that an entry is sensible. Types include presence, data type, range, length, format and list. Each one tests a different property of the entry.
- 90if value.strip() == '':
- An existence check tests that a value was actually entered. strip() removes spaces, so this is True for empty or space-only input, and an error message can be shown.
- 91type check
- A check that input is the expected data type, using .isdigit(), try/except around int() or float(), or isinstance(). input() is always text, so check before converting.
- 921 <= age <= 120
- A range check: tests that a number lies between a minimum and a maximum (inclusive here). Values outside the limits, such as 0 or 121, are rejected as invalid.
- 93len(pin) == 4
- A length check compares len() of the text with a required length or limit, such as exactly 4 characters for a PIN, to accept or reject the input.
- 94code.isdigit() and len(code) == 4
- A format check tests that text follows an expected pattern, such as 4 digits for a postcode, using string methods like isdigit(), isalpha(), slicing and len().
- 96while 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.
- 97def is_valid_age(text):
- A validation function that runs the existence, type and range checks in order and returns True or False, so the same checks can be reused for many inputs and tested.
- 98test data
- Values chosen to test each validation rule: empty for existence, text for type, and values just inside and just outside range limits, each with an expected result.
- 99GUI
- A graphical user interface: windows and controls like buttons and text boxes the user clicks or types in. The program waits for events, such as a click, and responds to each one.
- 100root = tk.Tk()
- Creates the main tkinter window after import tkinter as tk. Call root.mainloop() at the end to show the window and wait for events like clicks.
- 101tk.Label(root, text='...')
- Creates a tkinter label that shows text in the window. Use .config(text=...) to change what it shows, such as displaying a result. Options like font and fg set style.
- 102entry = tk.Entry(root)
- Creates a text box in the window. Call entry.get() to read what the user typed. It is always a string, so convert it with int() or float() to use it as a number.
- 103tk.Button(root, text='Go', command=show)
- Makes a button that runs the function show when clicked. Write the function name with no brackets, or it runs straight away instead of on click.
- 104control.grid(row=0, column=1)
- Places a control in a table-like layout at the given row and column. pack() instead stacks controls in order. Never mix grid and pack in one window.
- 105StringVar()
- A tkinter variable that stores the user's pick from a choice control (Checkbutton, Radiobutton or Combobox). Link it with variable= and read the choice with .get().
- 106messagebox.showinfo()
- Pops up a message window to tell the user a result. Its partner messagebox.showerror() pops up an error, such as when a handler finds invalid input. Both need a title and a message.
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.