Creating a Boolean

Now it is time to create a Bool, and we will make it a constant. Enter the following code:

let isConstant:Bool = true

Since isConstant is set, let's make it false by adding this:

isConstant = false

On the same line as what you just entered, you now will see a red circle with a white dot. The red circle means that there is an error. The white circle inside of it means that Xcode can fix the error for you (most of the time):

You also will notice an error in your Debug panel, which is just a more detailed version of the error. This error is telling us that we are trying to change the value of a constant when we cannot do so.

If you tap on the circle, you will see that Playgrounds suggests that you change the var to a let, since you cannot assign a value to a constant:

Since we want it to remain a constant, let's delete the line isConstant = false. We have covered basic data types, but there are some other programming basics we should discuss as well.