In this section we will learn what our variables and how to declare them as variables belongs to a certain
type.
We will also be looking at numbers string and boolean types variables are references to a space in memory.
These references are associated with an arbitrary name we use variables to hold values and operate with
them.
There's two ways to define variables.
On the first one we do like this.
Var h in this means var indicates the final declaration.
Age is the name we assign to that variable which presumably means that we're going to store some H and
Third the type and refers to integer.
So what we're doing here is what we're saying.
We want to declare a very local age which is going to be storing integral values.
The second way to do it is a much shorter version of the same.
And you have to write it like this age Col on equal as a number let's say 0 because we're initializing
the variables so the compiler will say 0 is a number.
So it should be the same type as before which is.
And now we have many types.
The core language define three main types numbers strings and boolean.
So we have different types of numbers.
We have integral numbers which are the natural numbers from 0 2 very big number.
We also have floats which is numbers with decimals.
Let's define an integer.
You will do it like this right.
X column equals 10.
If we want to define float number we will do it like this.
Why.
Colon equals five point three.
Even if those variables looks pretty similar they are not.
So if I want to add x plus y we have invalid operation because the ties are different so it can be added
with a float.
Something very important to note here is that values can change X can be 10 and then I can do X equals
2.
Well both types count.
Another type is string which we saw in the previous section.
So if I want to name equals to John.
Name will be of type String.
This is the same as doing var Name Type stream.
Equals to John.
A difference between these two notation is that these can be defined at the package level which is outside
any function and these notation with the call on equal can just be defined inside functions.
The last time I want to show you is the boolean type which can have just two values true or false.
So let's say I want to define a boolean variable.
I will do var v bool.
We're gonna go into more detail with this type and the control structure sections.
So regarding variable that's all.
Remember there's two ways to write it down.
Long version and the short version and they are pretty useful for passing values to defined functions
functions is going to be explained next chapters.