Breaking down the basics of computer variables for kids

Posted on Apr 19, 2021

Variables are one of the building blocks of programming. So, as you continue your journey teaching coding for kids, you’ll need to spend some time with the three main types of variables. The good news: they’re pretty simple. The even better news: we have a fun variables in coding song that teaches strings, numbers, and Booleans in an engaging and visual way.

What are variables?

When learning coding for beginners, you’ll come across variables. Variables are just things that store information. That information is sometimes called data or values, and, importantly, it can change. Programmers give their variables names so they can quickly and easily refer to them as they write their code.

Variables are like buckets!

Variables are like buckets. Whatever you put ‘in’ the bucket becomes the variable!

We know programming can start to feel a little abstract, and that’s why we like to compare variables to containers or buckets. For example, let’s say you’re programming a computer game and have a bucket called ‘the score.’ This bucket contains a number representing the player’s score – whether that’s three or three-hundred-billion-quadrillion. In that same computer game code, you might have another bucket called ‘player name,’ which contains the name the player inputs.

Listen to the whole Coding Songs album here!

Three types of variables: strings, numbers, Booleans

Not all variables are created equally. There are three main types of variables, each of which can only contain a certain kind of data.

Variables in coding for kids: Strings

The first kind of variable is strings. Not the long, wiggly type of string, but a string of letters or words. These buckets happily hold sentences, phrases, and all kinds of words.

So, you might have a bucket called ‘Days of the week,’ and the value can change from Monday to Tuesday, Wednesday, Thursday, Friday, and so on. Or, you might have a bucket called, ‘What I’m having for dinner,’ which can hold data like spaghetti Bolognese or spicy tacos.

Variables in coding for kids: Numbers

The second kind of variable is numbers. This one’s super-duper straightforward: number variables can contain, well, numbers. Big numbers, small numbers, prime numbers, any number – there’s no limit to the type of number a number bucket can hold.

So, you might have a bucket called, ‘How old my dog is,’ and the value might be 2 or 7 or 3 or 13. You might have another bucket called, ‘How many spicy tacos I ate for dinner,’ and the data might show you ate a record-breaking 11 spicy tacos.

Variables in coding for kids: Booleans

Yes, Boolean is a funny word. It sounds kind of like ‘balloon.’ Although it’ll probably be a new addition to your young learners’ vocabulary, Booleans are actually the most straightforward kind of variable. They can have one of two types of data: true or false. There is no in-between and no shades of grey here – it either is or isn’t.

So, you might have a bucket called, ‘Am I hungry?’ The data will either say, ‘False’ (maybe you just ate 11 spicy tacos – no judgment) or ‘True.’ You might have another bucket called ‘Is it October?’ Again, the information inside the bucket can only be ‘True’ or ‘False.’

There are 3 types of variables: strings, numbers, and booleans

Variables are like buckets. Whatever you put ‘in’ the bucket becomes the variable!

Coding basics for kids

There you have it – one of the foundational building blocks of coding. Variables are like buckets; they hold information. Coders give variables names, and the information contained within a variable can change. There are three types – strings, numbers, and Booleans – each of which can hold a particular sort of data. Easy? Easy.

You and the kids can learn all about variables in our coding for kids song. It details the basics of variables in a fun, visual, and easy-to-understand way. Watch now!

Hey there!

Did you know that Scratch Garden has a 2nd Channel? With a growing library of more than 50 videos?

It's all true! We have created a whole other channel on Patreon! Patreon allows creators like Scratch Garden to offer a kind of membership for special fans like you. In exchange for your support, you can access monthly patron-only content like behind-the-scenes videos, Halloween and holiday videos, as well as many hilarious Blooper Videos

For as little as $2/month you can watch all these videos AND help support Scratch Garden to keep making great fun educational content. 

Check out our 2nd Channel to find out more!


Leave a Reply