Learning objective

  • To debug Python code by spotting and fixing errors in spacing, syntax and loops.

Success criteria

  • I can identify and describe different types of
Lock

This content is for subscribers only. Join for access today.

National curriculum

Computing

Pupils should be taught to:

  • Design,
Lock

This content is for subscribers only. Join for access today.

Before the lesson

Lock

This content is for subscribers only. Join for access today.

Lesson plan

Recap and recall

Explain that the children will be talking with a partner to recall what they learnt about remixing a project in Scratch. Display the Presentation: Speak like an expert and arrange the children in pairs. Allow time for discussion using key vocabulary.

Lock

This content is for subscribers only. Join for access today.

Adaptive teaching

Pupils needing extra support

  • Could use the Knowledge organiser to help identify and name different error types (syntax, logic and loop errors) before attempting to fix them.
  • Could take on the role of running the program and describing what happens on the micro:bit simulator while their partner reads the code aloud, helping them link what they see to specific lines of code.
  • Could use the Debugging checklist to work through the code line by line when they are unsure where the bug is.
  • Could act as the ‘checker’ once a fix is applied to confirm that the program runs without red error messages.

Pupils working at greater depth

  • Should predict the program’s output before running it and justify their reasoning by referring to loop values, indentation and syntax.
  • Should evaluate more than one possible cause for a bug and explain why one is the most likely based on how Python executes the code.
  • Could create a short buggy Python program (for example, with a syntax, indentation or loop error) for another team to debug.
  • Could support other pupils by explaining clearly how a specific fix works and why it resolves the error.
Lock

This content is for subscribers only. Join for access today.

Assessing progress and understanding

Pupils with secure understanding indicated by: identifying and describing spacing, syntax and

Lock

This content is for subscribers only. Join for access today.

Vocabulary definitions

  • .hex file

    The file type that stores a program for the micro:bit.

  • debug

    Finding and fixing mistakes in code to make a program work correctly.

Lock

This content is for subscribers only. Join for access today.

Our team comprises experienced classroom teachers who love the foundation subjects
Find out more
Kapow logo

Maintained by: Kapow Primary team

_
Please don’t screenshot or copy images from this page.
Kapow Primary resources are created by teachers and protected by copyright. Copying images or slides into your own presentations (for example using the Snipping Tool) counts as reproducing the resource and isn’t permitted under the Kapow licence.
This resource is being accessed through your school’s Kapow licence.
Thank you for respecting the work of the teachers who create these materials.