Line At A Time
Lesson 1: Hello, World!
Hello, World! Make the computer say hello, every programmer's first program.
1print("Hello, world!")
Terminal
$ swift main.swift
Hello, world!
Every line, explained
print("Hello, world!")
print(...) shows whatever is inside its round brackets in the terminal, then moves to a new line. All lowercase, both brackets needed, and no semicolon at the end; Swift doesn't use them. The text goes inside double quotes: "Hello, world!" is a String, a piece of text.