Intro to Programming (Python)

High School (9-10) · Computer Science

This topic covers writing your first working Python programs: variables, input and output, conditionals, loops, lists, and functions. Sessions are spoken, so you describe what your code should do and talk through what it actually does, line by line. Most of the work is reading small programs out loud, predicting the output, and then fixing the ones that behave differently than expected. Suitable for a student in Year 9 or 10 taking a first coding class, working through Codecademy or similar, or preparing for a GCSE-style or intro CS course assessment.

Start a session on Intro to Programming (Python)

What this covers

  • Variables and types: assigning values, telling int from float from str, and using int() and float() on input() so arithmetic works
  • Conditionals: if / elif / else, comparison operators, and combining tests with and, or, not without nesting unnecessarily
  • Loops: for loops over range() and over lists, while loops with a changing condition, and choosing between the two
  • Lists and strings: indexing from zero, slicing, len(), append, and looping through items to total or count them
  • Functions: defining with parameters, returning a value versus printing it, and understanding why a variable made inside a function disappears outside it
  • Reading error messages: tracing IndentationError, NameError, TypeError, and IndexError back to the line that caused them

Where learners get stuck

Using = when you mean ==
In maths, = states that two things are equal. In Python it assigns. Students write if score = 10: and get a syntax error that does not mention equality at all, so the fix is not obvious.
Treating input() as a number
input() always returns a string, so age + 1 raises a TypeError and score1 + score2 glues "7" and "8" into "78". The program looks correct, and the concatenation case runs without any error, which makes it harder to spot.
Confusing return with print
Both seem to 'give back' an answer during testing. A function that prints looks fine when called on its own, then breaks when the result is stored in a variable and turns out to be None.
Off-by-one errors with range() and list indices
range(5) stops at 4 and the last index of a 5-item list is 4, but everyday counting starts at 1. Loops then miss the final item or crash with IndexError on the last pass.

What a session looks like

A session usually starts with you describing a program you are writing or one that is not working. You read the code aloud or paste it in, and Evelyn asks you to predict what each line does before running it, so the gap between what you meant and what you wrote becomes visible. Then you work through short trace exercises: given this loop, what does it print on pass three? Later in the session you plan a small program out loud (what variables, what decisions, what repeats) before writing any of it, and finish by explaining one piece of code back in plain language.

Helpful to know first

  • Comfort with basic arithmetic, including remainders and percentages
  • Ability to follow a step-by-step set of instructions in order
  • Access to somewhere to run Python, such as IDLE, Thonny, or an online editor like replit
  • No prior programming experience needed

Questions

Can my child learn Python if they have never coded before?
Yes. The topic starts from print() and variables and assumes no prior programming. If they have already covered loops in Scratch or Blockly, that transfers well and sessions can move faster to functions and lists.
How is voice tutoring useful for something you have to type?
Most beginner bugs come from not being able to say what a line of code is supposed to do. Explaining a loop out loud, or predicting output before running it, exposes the misunderstanding faster than retyping the code. You still write the code yourself in your own editor between and during sessions.
Does this cover Python 2 or Python 3?
Python 3. Older tutorials use print without brackets and raw_input(), which will not run in current Python, and sessions point that out if you bring in code from one.
Will this help with GCSE Computer Science or a first-year high school CS class?
It covers the programming fundamentals those courses assume: sequence, selection, iteration, lists, functions, and trace tables. It is not affiliated with any exam board and does not replace your school's specification or coursework requirements.

Other High School (9-10) Computer Science topics