TASK 1

Variables

It is often really useful to keep the value of something for later use when you are programming. For example, it would be really annoying if websites asked for your login and password every time you went to a new page!

To solve this problem, we can remember values in code by assigning them to variables

A variable is like a box, you can put the value into the box, and later on when you want that value again, you can just get it out of the box.

Since you might end up with lots of boxes, we put labels on the boxes, called identifiers.

The identifier is the name of your variable, and your variable holds a value.

Don't worry, if that sounds a little complicated, here is an example!

x : int = 10

Okay, so here we used the identifier x for a variable, which holds an int.

This tells the computer to get an int shaped box ready, and put the label x on the front.

Do you have any idea what the code print(x) might output?


Remeber, x is the variable, not a string!


Close this box and find out if you are right!

Well done!

When you are ready, continue on to the next task.

Something isn't quite right...

Close this message and have another go!

GUIDE

This guide is intended to help with syntax. See the prelude section for pre-defined functions and variables. See the tutorials page for tutorials on how to write code.



Can't find what you're looking for?

Check the tutorials page for more!

PRELUDE

The prelude is all the pre-defined functions and variables available to use. See the tutorials page for tutorials on how to write code.



Can't find what you're looking for?

Check the tutorials page for more!