Lesson 1 of 15

Hello, World!

Your First Swift Program

In Swift, print() outputs text to the console, followed by a newline:

print("Hello, World!")

You can print multiple values by separating them with commas — Swift will join them with spaces:

print("The answer is", 42)
// The answer is 42

Comments

Single-line comments start with //, multi-line use /* ... */:

// This is a comment
print("code") // inline comment

Your Task

Print exactly Hello, World!.

JS Transpiler loading...
Loading...
Click "Run" to execute your code.