Intro to Coding

Middle School (6-8) · Computer Science

This topic introduces the core ideas behind writing code in a text-based language, usually Python, for students in grades 6-8. Sessions focus on what a program actually is: a sequence of instructions the computer runs in order, storing information in variables, making decisions with if statements, repeating work with loops, and packaging steps into functions. Students talk through what a short program will print before running it, then trace what actually happens line by line when it doesn't match. Work is spoken and worked through aloud, so a learner can describe their code, read an error message, and reason about what to change.

Start a session on Intro to Coding

What this covers

  • Writing and reading variables: assignment, updating a value, and the difference between the number 5 and the text "5"
  • Using input() and print() to build small interactive programs, and converting input text to numbers with int() or float()
  • Writing if / elif / else conditions using comparison operators, including combined conditions with and / or
  • Building for loops over a range and while loops with a stopping condition, and choosing which fits a problem
  • Defining functions with parameters and return values, then calling them with different arguments
  • Reading Python error messages (SyntaxError, NameError, TypeError, IndentationError) and tracing code by hand to find the bug

Where learners get stuck

Thinking = means "is equal to" rather than "put this value into"
Years of maths lessons train students that = states a fact. In code, x = x + 1 looks impossible, and comparing with == feels like a typo, so students write if score = 10 and get a syntax error they can't explain.
Believing the computer re-runs earlier lines when a variable changes later
Students imagine a spreadsheet, where a formula updates itself. So they assume total = a + b will change when a changes afterwards. Hand-tracing line by line with a value table fixes this faster than more examples.
Confusing the string "12" with the number 12
input() always returns text, but on screen 12 looks like a number. Students then get "1212" instead of 24 and think the computer made an arithmetic mistake rather than joining two pieces of text.

What a session looks like

A session usually starts with the learner explaining a short program out loud and predicting its output before anything runs. Evelyn then poses a small problem - a countdown, a password check, a running total - and asks the student to say the steps in plain English first, then translate each step into code. When something breaks, the focus is on reading the error message and tracing variable values one line at a time rather than being handed the fix. Sessions typically close with a small change to the program, such as adding a second condition or turning repeated lines into a function, so the student applies the idea once more independently.

Helpful to know first

  • Comfort with basic arithmetic, negative numbers, and comparing quantities with greater than / less than
  • Ability to type and to work in a code editor or online Python environment
  • Helpful but not required: earlier experience with Scratch or another block-based tool

Questions

Does my child need to know Scratch before starting text-based coding?
No. Block coding helps, but it isn't required. If a student has used Scratch, sessions connect the blocks they already know to their typed equivalents; if not, the concepts are built from scratch using short worked examples.
Which programming language is used?
Python is the default, because its syntax is short enough to read aloud and it is the language most middle and high school courses move into next. If a student's school uses JavaScript or another language, the same concepts can be taught in that syntax.
How can a voice tutor teach coding without seeing the screen?
The student reads their code and error messages aloud, and Evelyn works through the logic with them - predicting output, tracing variables, and asking what a specific line does. Explaining code in words is a large part of learning to debug it.
My child gets stuck the moment there's an error message. Is that normal?
Yes, it's the most common blocker at this level. Sessions treat error messages as readable information: which line, which type of error, and what that type usually means. Students practise finding the cause themselves before changing anything.

Other Middle School (6-8) Computer Science topics