TASK 3

Assignment

So, you cannot put something that is the wrong datatype into a variable.

However, you can replace what is stored by the variable with another value of the same dataype.

So, say we have a variable:

x : int = 5

And then, we decide to store a different value:

x = 6

Now the variable has 6 inside, notice that we didn't have to say the datatype? This is because the computer already has an integer-shaped box called x, this just tells the computer to replace what is inside the box

We call this Assignment

In the following task, we have created a variable with the identifier x and intitally set it's value to 10.

Your task is to assign a new value to x, anything that isn't 10. However, you must do so after the print statement using an assignment!

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!