-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

iOS 15 Programming for Beginners
By :

Now that you know about the simple data types that Swift supports, let's look at how to store them, so you can perform operations on them later.
You can use constants or variables to store data. Both are containers that have a name, but a constant's value can only be set once and cannot be changed after it has been set, whereas a variable's value can be changed at any time.
You must declare constants and variables before you use them. Constants are declared with the let
keyword whereas variables are declared with the var
keyword.
Let's explore how constants and variables work by implementing them in your playground. Follow these steps:
let theAnswerToTheUltimateQuestion = 42 let pi = 3.14159 let myName = "Ahmad Sahar"
In each case, a container is created and named, and the assigned value...