Let's try out variables by declaring a variable and printing its value in our program.
The example above introduces the variable number_of_shirts
.
We can also name our variable shirt_count
or num_of_shirts
or shirts_num
or any desired name.
number_of_shirts
is an arbitrary name we have given to our variable.
The number_of_shirts
is assigned the value 5
using the =
operator.
We can modify a variable's value or use it with operators as follows.