Eastlea Community School pupils joined the prime minister for an hour of coding today.

It was part of Downing Street’s Hour of Code week, which aims to teach children “vital” technology skills to pupils and runs until Sunday.

David Cameron and education secretary Nicky Morgan joined the Pretoria Road pupils in a coding tutorial that used the gaming reality of Minecraft to teach code.

Pupils then impressed the politicians by showcasing projects devised on a BBC micro:bit, a pocket-sized computer that will be free to all Year 7 learners in the New Year.

David Cameron believes this will help children develop core digital skills.

“It’s crucial that we give our young people the skills they need to get on so they can compete for the best jobs of the future,” he said. “In this digital age, coding matters, which is why initiatives such as the Hour of Code are so important and why we’ve embedded it in our national curriculum alongside.”

And education secretary Nicky Morgan said the Hour of Code showed just how accessible digital education is for young learners.

“The Hour of Code initiative shows that coding is for everyone and, by learning these digital skills, all pupils can have the opportunity to fulfil their potential to get on in life,” she said. “The world is changing and it is essential that we have a generation of young people with the knowledge and skills to become active creators of digital technology, not just consumers of it.

“Today I’ve written my first line of code and now I’m challenging all parents to do the same.”