In this Swift Tutorials : Swift Basics lesson we will tell you how to print constants or variables in Swift.

Before you start please Create or open a Swift Playground .
For this lesson use a playground titled 1.Swift Tutorials by the, created in the first Swift Basics lesson or create the new one.

Follow Along

To print string use “” inside a print() statement

Open a swift playground and type:

Let’s create a constant name

To print the name constant type:

Now let’s insert our constant inside the String

Let’s create a lastName variable. Let’s imagine that our person can change his surname.

Now to print name with our lastName together let’s type the following.

Notice that we are using ” ” to divide name from the lastName. We are using + to concatenate the strings together.

As a result you will see the following in your playground:

How to print in Swift

How to print in Swift

Now you know how to print in Swift

Discover all tutorials at 👉 Swift Tutorials Navigation

This lesson is a part of Swift Tutorials and Lessons created by the Team. Feel free to save and share this post to social if you find this lesson useful or helpful.