An ordered set of instructions. It reads input, follows rules, and produces output.
Loading...
Loading...
Workspace
iOS macOS apps safe systems and modern Apple development
Definition first
Swift is a programming language for writing exact instructions, often used for iOS macOS apps safe systems and modern Apple development. Start with one mental model: input goes through steps and becomes output.
main.swiftRun swift main.swiftHabit Use optionals deliberately and keep playground examples smallAn ordered set of instructions. It reads input, follows rules, and produces output.
A value is data. A variable is the name you use to hold and reuse that data.
A named piece of work. It takes input, does one job, and can return a result.
Swift toolchain is the place that actually runs code from main.swift.
First readable code
print(42)
Output 42Language lineage
See where Swift comes from, which languages feel close, and what to learn next.
iOS, macOS, Apple apps, and modern client architecture
Zero base path
Question bank
Pick a stage or search across the open programming bank. Jump straight to the matching drill.
Swift question 1. Choose the statement that matches printing a value.
Swift question 2. Choose the statement that matches naming a value.
Swift question 3. Choose the statement that matches reusable function.
Swift question 4. Choose the statement that matches basic collection.
Swift question 5. Choose the statement that matches printing a value.
Swift question 6. Choose the statement that matches naming a value.
Swift question 7. Choose the statement that matches reusable function.
Swift question 8. Choose the statement that matches basic collection.
Swift question 9. Choose the statement that matches printing a value.
Swift question 10. Choose the statement that matches naming a value.
Swift question 11. Choose the statement that matches reusable function.
Swift question 12. Choose the statement that matches basic collection.
Swift question 13. Choose the statement that matches printing a value.
Swift question 14. Choose the statement that matches naming a value.
Swift question 15. Choose the statement that matches reusable function.
Swift question 16. Choose the statement that matches basic collection.
Swift question 17. Choose the statement that matches printing a value.
Swift question 18. Choose the statement that matches naming a value.
Multiple choice
Swift question 1. Choose the statement that matches printing a value.
print(42)
Reference
swift main.swiftentry point output syntax print
print(42)
variables assignment types let
let total = 42 print(total)
function collection Array
func add(_ a: Int, _ b: Int) -> Int {
return a + b
}
let scores = [40, 2]
print(scores.count)