Skip to content

First lessons with Python and the micro:bit

Unit of work

6 lessons

Python

9-12 yrs, 11-14 yrs

Help your learners transition from block-based to text-based coding with six familiar projects. This unit of work is ideal for learners who have previously completed First lessons with MakeCode and the micro:bit, as each lesson compares the MakeCode blocks with the Python code for each project.

The micro:bit Python Editor has been designed to help overcome barriers to text-based coding in the classroom, making it easier to be creative by supporting debugging and discovery of working code snippets.

Projects include a name badge, animation, using inputs and outputs to make an emotion badge, using sensors to make step counters and nightlights, and finally combining skills from previous lessons to make a rock, paper, scissors game.

Computational thinking:

Algorithms

Computer systems:

Input/output

Sensors

Digital arts:

Animation

Programming:

Iteration

Randomisation

Selection

Sequence

Text-based programming

Variables

Overall key learning

  • Explain what Python is and why it’s useful to learn to code in Python.
  • Find your way around the Python Editor using its features that support creativity and debugging.
  • Give the micro:bit instructions in text-based code to make a variety of projects.
  • Know why the sequence of instructions is important.
  • Understand that inputs and outputs involve the flow of data in and out of computers. 
  • Know that sensors are inputs that sense things in the real world such as movement and light. 
  • Know that the accelerometer is a sensor, an input that senses movement. 
  • Understand that logic is how computers make decisions in code based on whether things are true or false.
  • Know that selection is making different things happen based on different conditions.
  • Understand that variables are containers for storing data which can be accessed and updated. 

Additional skills

Debugging, evaluation, modifying, prototyping.

Lesson 1: Python name badge

Learn what Python is, explore the Python Editor, and make a name badge.

Key learning:

  • I can explain what Python is and why it’s useful to learn to code in Python.
  • I can find my way around the Python Editor using its features that support creativity and debugging.
  • I can give the micro:bit instructions in text-based code to make a name badge using the LED display output.

Computational thinking:

Algorithms

Computer systems:

Input/output

Programming:

Iteration

Text-based programming

Lesson 1 details

Lesson 2: Python beating heart

Create an animation to learn about sequence and simple loops.

Key learning:

  • I know why the sequence of instructions is important.
  • I can write instructions in Python to create a forever (infinite) loop.
  • I can give the micro:bit instructions in text-based code to make a beating heart animation.

Computational thinking:

Algorithms

Digital arts:

Animation

Programming:

Iteration

Sequence

Text-based programming

Lesson 2 details

Lesson 3: Python emotion badge

Start learning about inputs and outputs using buttons and icons on the display.

Key learning:

  • I understand that inputs and outputs involve the flow of data in and out of computers. 
  • I can apply this knowledge to the micro:bit’s button inputs and display output.
  • I can write instructions in Python to make something happen when a button is pressed on the micro:bit.

Computer systems:

Input/output

Programming:

Text-based programming

Lesson 3 details

Lesson 4: Python step counter

Introduce variables to track your step count and begin to use the accelerometer input.

Key learning:

  • I can explain that the accelerometer is a sensor, an input that senses movement. 
  • I can explain that variables are containers for storing data which can be accessed and updated. 
  • I can write instructions in Python to turn my micro:bit into a step counter using the accelerometer and variables.

Computer systems:

Input/output

Sensors

Programming:

Text-based programming

Variables

Lesson 4 details

Lesson 5: Python nightlight

Make an automatic nightlight and learn about sensors and logic.

Key learning:

  • I can program a micro:bit using text-based code to make a light that switches on when it gets dark.  
  • I can explain that sensors are inputs that sense things in the real world such as movement and light. 
  • I can explain that logic is how computers make decisions in code based on whether things are true or false.

Computer systems:

Input/output

Sensors

Programming:

Selection

Text-based programming

Lesson 5 details

Lesson 6: Python rock, paper, scissors

Combine skills from the previous lessons to turn your micro:bit into an electronic simulation of a popular game of chance.

Key learning:

  • I can use text-based coding to program a rock, paper, scissors game.  
  • I can explain how combining inputs, variables, random numbers, and selection can make a game. 
  • I can adapt my program to make my own game.

Computer systems:

Input/output

Sensors

Programming:

Randomisation

Selection

Text-based programming

Variables

Lesson 6 details

England National Curriculum

Curriculum aims:

  • [Pupils] can understand and apply the fundamental principles and concepts of computer science, including abstraction, logic, algorithms and data representation.
  • can analyse problems in computational terms and have repeated practical experience of writing computer programs in order to solve such problems.

KS2 Computing

Subject content

  1. Design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts
  2. Use sequence, selection, and repetition in programs; work with variables and various forms of input and output
  3. use logical reasoning to explain how some simple algorithms work and to detect and correct errors in algorithms and programs

KS3 Computing

Subject content

  1. use 2 or more programming languages, at least one of which is textual, to solve a variety of computational problems.

Read the full computing curriculum.

Scotland Curriculum for Excellence

Technologies: Computer Science, Second level

  1. I can understand the operation of a process and its outcome (TCH 2-13a).
  2. I can explain core programming language concepts in appropriate technical language (TCH 2-14a).
  3. I can create, develop and evaluate computing solutions in response to a design challenge (TCH 2-15a).

Technologies: Computer Science, Third to fourth level

  1. I understand constructs and data structures in a textual programming language (TCH 4-14a).

Read the full Curriculum for Excellence: Technologies.

Northern Ireland Curriculum

Primary

Prerequisite Skills in Using ICT across the curriculum

  1. Explore - investigate, make predictions and solve problems through interaction with digital tools.
  2. Evaluate - talk about, review and make improvements to work, reflecting on the process and outcome.

Read the full Northern Ireland curriculum - primary

CCEA Primary Using ICT Desirable Features

Computational Thinking and Coding, Level 4

Programmable devices (including micro:bit)

Pupils should:

  1. look at and talk about examples of coding projects, including the use of motion, looks, lights or sounds, sensors, control and events such as ‘if…then’ and ‘loop until’ (or equivalent) that make the code more efficient.
  2. recognise that these projects are composed of different components and break the task into smaller manageable tasks (decomposition).
  3. use a range of commands to create a project including triggering commands such as ‘if...then’ and ‘loop until’ to facilitate a more efficient method of interaction.
  4. test and debug at regular intervals and collaborate with others to solve problems as they arise.

Read the CCEA's Using ICT Desirable Features

Secondary

Science and technology, Technology and design

  1. Show deeper understanding by thinking critically and flexibly, solving problems and making informed decisions, using Mathematics and ICT where appropriate.
  2. Demonstrate creativity and initiative when developing ideas and following them through.

Read the Technology and design curriculum

Curriculum for Wales

Science and technology

Computation is the foundation for our digital world

Progression step 1

I can experiment with and identify uses of a range of computing technology in the world around me.

Progression step 2

  1. I can safely use a range of tools, materials and equipment to construct for a variety of reasons.
  2. I can create simple algorithms and am beginning to explain errors.
  3. I can follow algorithms to determine their purpose and predict outcomes.
  4. I can follow instructions to build and control a physical device.

Progression step 3

  1. I can use conditional statements to add control and decision-making to algorithms.
  2. I can identify repeating patterns and use loops to make my algorithms more concise.
  3. I can explain and debug algorithms.
  4. I can use sensors and actuators in systems that gather and process data about the systems’ environment.

Progression step 4

  1. I can select and use multiple sensors and actuators that allow computer systems to interact with the world around them.

Progression step 5

  1. I can test, evaluate and improve a solution in software.
  2. I can design and create physical systems that use appropriate components and logic to complete tasks and achieve goals.

Read the full science and technology curriculum

USA CSTA Standards

Grades 3-5

  1. IB – AP – 09 Create programs that use variables to store and modify data.
  2. IB-AP-10 Create programs that include sequences, events, loops, and conditionals.
  3. IB-AP-12 Modify, remix, or incorporate portions of an existing program into one's own work, to develop something new or add more advanced features.
  4. IB-AP-14 Debug (identify and fix) errors in an algorithm or program that includes sequences and simple loops.
  5. IB-AP-15 Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended.

Grades 6-8

  1. 2-AP-11 Create clearly named variables that represent different data types and perform operations on their values.

Read the CSTA Standards in full.

You may also be interested in

Introduces our Python Editor that helps learners to write code for the BBC micro:bit. We will highlight all the great features in our editor that support you and your learners to code the micro:bit successfully using Python.

A sequence of lessons that provide a pathway through six projects, ideal for getting started with the micro:bit. Students develop their use of some core computing concepts by coding and making practical projects including step counters, nightlights, and games.

Seven lessons introducing AI in general and unpacking what students already know about sorting data, before getting hands-on, creating, testing and improving their own machine learning models to be used as new inputs in code on the micro:bit.