What has to be true about your code before it can be tested — and how do unit, regression, and integration tests build on each other?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
Three different places in a program each tidy up a raw name the same way: remove the whitespace around it, fold it to lowercase, and drop every hyphen. One of the three copies has already drifted out of step with the other two. Pull the cleanup into a single function named clean_name so there is exactly one place to change, and give it a docstring answering the video's three questions — what input it expects, what it does, what it returns.
Hint: .strip(), .lower() and .replace() are the three string methods involved.
Defensive programming habits
Record the two habits: writing docstrings and comments while the code is being written, and pulling copy-pasted code out into one function called from several places.
Testing and validation versus debugging
Define testing as writing down inputs with their expected outputs before running, define debugging as the work that starts when an actual output disagrees, and record the syntax-error and runtime-error split.
Three kinds of test and how they stack
Write what a unit test exercises, what regression testing adds once a bug is found and re-runs after a fix, and what integration testing assembles, using Hangman's functions and its while loop.