Hello World!
Part of the Fundamentals section of Coddy's Swift journey — lesson 2 of 86.
The "Hello World!" is a simple program that outputs Hello World! to the screen.
In Swift, we use print() to show words on the screen. The words go inside quotation marks.
Let's take a look at the "Hello World!" program in Swift:
print("Hello World!")Challenge
BeginnerUse the code view to write a program that outputs Hello World!
Note that anything inside quotation marks is case sensitive. For example:
print("Hello World!")print("hello world!")are different things (notice the capital letters in the first line).
Cheat sheet
To print to the console in Swift, use print():
print("Hello World!")Text inside quotation marks is case sensitive.
Try it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
4Operators Part 1
Arithmetic OperatorsModulo OperatorCompound AssignmentRecap - Simple MathComparison Operators7Basic IO
Print FunctionString InterpolationReadLine InputType ConversionRecap - Till 120Recap - True or False10Functions
Declare A FunctionParameters And ArgumentsReturn ValuesArgument LabelsRecap - Sigma FunctionRecap - Validation FunctionDefault Values13Iterating Over Sequences
Iterating Over ElementsThe Enumerated MethodIterating Over Strings P1Iterating Over Strings P22Variables
Let vs VarType AnnotationsNumbersStringBooleanNaming ConventionsRecap - Initialize Variables5Operators Part 2
Logical Operators Part 1Logical Operators Part 2Recap - Simple LogicLogical Operators Part 3Ternary Operator8Bill Split Calculator
Welcome MessageGetting Input3Optionals
What Are OptionalsUnwrapping With If LetGuard LetNil Coalescing OperatorRecap - Safe Unwrapping9Loops
For-In LoopWhile LoopRepeat-While LoopBreakContinueRecap - FactorialRanges In LoopsNested LoopRecap - Dynamic Input