Learn
Hello World
Print

We learned how to output a line of text with the following code:

print("๐Ÿš™๐Ÿ’จ")

It will output:

๐Ÿš™๐Ÿ’จ

We can also output multiple lines by adding more print() statements:

print("Hello") print("Goodbye")

This will output:

Hello Goodbye

Notice how the order of the printed statements matches the order of our code. Thatโ€™s because Swift code is read from top to bottom.

Now letโ€™s use what we learned so far to complete a coding challenge.

Instructions

1.

Instead of displaying those two lines in the code editor, edit the code so that we output the following pattern in the terminal:

1 2 3 4 5 6 7 8 9 10

Exactly how it is.

Remember you can use the hint if you need help.

Folder Icon

Take this course for free

Already have an account?