Everything you need before the bell rings
Learning Objectives
Students will be able to…
- ✓Validate input.
- ✓Check type & range.
- ✓Handle bad input.
- ✓Prevent crashes.
What happens when a user types something your program didn’t expect?
Order the Validation Steps
Project this and have students put the input-validation steps in order.
50 minutes, five moves
Tap any phase to open the teacher moves and student actions.
Hook — Bad Input
What if your program asks for a number and the user types "banana"?
👩🏫 Teacher Moves
- Pose the question.
- Share ideas.
- Set the goal.
🎒 Student Actions
- Think.
- Share.
- Get ready.
Use — Input Validation
Students learn.
👩🏫 Teacher Moves
- Send students to Order the Validation Steps.
- Order them.
- Note handle bad input.
🎒 Student Actions
- Order.
- Say.
- Note it.
Modify — Try It
Students practice.
👩🏫 Teacher Moves
- Get a number input.
- Check the type.
- Check the range.
🎒 Student Actions
- Get.
- Type.
- Range.
Create — Create
Students apply.
👩🏫 Teacher Moves
- Add validation to a program.
- Handle bad input.
- Re-ask the user.
🎒 Student Actions
- Validate.
- Handle.
- Re-ask.
Reflect — Reflect
Students close.
👩🏫 Teacher Moves
- What’s the first step?
- Why validate input?
- Complete the exit ticket.
🎒 Student Actions
- Say it.
- Say it.
- Complete the exit ticket.
Built to the standards you report on
Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students.
Validate input and handle errors.
Design robust programs.
Develop and test defensively.
Anticipate program edge cases.
One lesson, every learner
Multilingual Learners
- Validation step cards.
- Frame: "first I get the ___."
- Validate a tiny program.
Support & Access
- Use 3 core steps.
- Check one type.
- Use a template.
Stretch & Extend
- Validate with try/except.
- Check a format (email).
- Loop until valid.
What to gather
- ⌨️Sample inputs
- 📽️Screen / board
- 💻Order the Validation Steps
- 💻Python
- 📓Notebooks
- 🎫Exit-ticket slips
Key terms — hover for a quick definition
Exit Ticket
Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students.
Reflect: input validation.
Have students add input validation to a program. A printable validation sheet is in the CS library.
Study the key terms
Tap a card to flip it, then rate whether you knew it. Built from this lesson’s vocabulary.
Nice work!
Check your understanding
A quick self-check with instant feedback, drawn from this lesson’s key terms.
Nice work!
Printable worksheet
A print-and-go review sheet with a built-in answer key. Tap “Show answer key” to reveal answers, or print the clean version for students.
Part A · Write the word that matches each meaning
- handles bad input well
- valid min/max values
- verifying the data type
- the expected pattern
- an unusual input
- asking for input
- dealing with problems
- checking user input
Part B · Show what you learned
- What is the first validation step?
- Why validate input?
- What do you do with bad input?
Part B: 1) Get the input from the user. 2) To stop programs from crashing on bad data. 3) Handle it — ask again or show a message.