Camp 1 · Step 2 of 12
Hello, Swift!
print, comments, string interpolation, and the pleasantly minimal anatomy of a Swift program.
Swift keeps ceremony low: statements run top to bottom, no boilerplate wrapper needed.
Printing
print adds a newline each call and accepts several values separated by
commas (joined with spaces).
String interpolation
Swift drops expressions into strings with a backslash-parentheses:
let name = "Ada"
let km = 13.0
print("\(name) hiked \(km) km")
print("In meters: \(km * 1000)")Anything inside \( ... ) is evaluated and inserted — Swift's answer to
Python's f-strings. You'll write this dozens of times a day.
Types, quietly present
Swift infers Int, Double, String — strong types without the
paperwork. Mixing them without converting is a compile error; Swift never
silently guesses (no JavaScript-style "2" + 2 surprises).
Which syntax inserts a value into a Swift string?
let count = 5 — what type does Swift give count?
What's next
let vs. var — and why Swift developers reach for let first, always.