How to learn how to code


As being able to code is soon to become a vital skill in society I thought it would be nice to have a place where people can recommend and discuss learning to code.

At the time of writing I am a 13 year old who can code:

Python, Arduino, VB console, HTML & CSS and I have a rough knowledge of the paralax propeller language.

I learnt to code the top down method.

This is where you take a piece of code say one of the unicornhat examples:

import time

import unicornhat as unicorn

Turns each pixel on in turn and updates the display.
If you're using a Unicorn HAT and only half the screen lights up, 
edit this example and  change 'unicorn.AUTO' to 'unicorn.HAT' below.


for y in range(height):
  for x in range(width):


and you fiddle around changing things and seeing what breaks for example you could change the time.sleep value and find that it becomes faster or slower.

or the colour by changing


and after playing around you will have learnt and worked out for yourself about RGB colour values.

Another way to learn would be the bottom up learning.

This is quite a popular method in schools and code clubs although that is changing as can be seen in bilge tank 069

You can go to
where you can choose from many tutorials that will guide you through the basics of the programming library and it is very beginner friendly. is a great place for this style as well

There is also the Do a project way

This quite simple to explain you want to do something so you just do it and every time you hit a boundary you go to somewhere like stackoverflow or you look it up in the docs for example.

I hope that helps newbies looking for a way to start.

Below are some links to great websites or books that people have recommend or that I have found useful


Old thread, but seeing as you didn’t get any replies I’ll bump it up and add a bit of my own personal experience to it.

I’m almost 60 and only learned to code in python in the last couple of years. I’m no expert, but I’m no noob either, lol. The Raspberry PI foundation will be happy as it was the purchase on my first Raspberry PI that started me coding. I happened on Python because most of the tutorials and examples were in python. I learned by trial and error, syntax error mostly, lol.

I’m a retired electronic technician. That lead me to playing around with sensors etc. Breakout boards that usually used i2c. Some GPIO stuff too. Lots of different things. It’s been loads of fun, and frustrating at the same time. More fun though, =)


I think I learned the most from a weather clock project I did. A Pi A+, Sense Hat, and SI1145 light sensor. I highly recommend anybody that’s not sure what they want to do to give the Sense Hat a consideration. IMHO you get a lot of bang for your buck. Temp, humidity, barometric pressure sensors onboard. Plus magnetometer and gyro’s, and an 8 x 8 RGB LED matrix. It was good enough for the International space station.