Thuta Learning
BasicProgrammingbeginner

Syntax & Hello World

Relax. We'll talk through this in plain words — no textbook voice.

Swift syntax is clean and easy to read. Unlike Java/C#, you don't always need a main() function — inside a Playground, code just runs from top to bottom.

import Foundation brings in the Foundation framework so you can use common utilities like dates, strings, and collections. It's not strictly required for a simple print example, but it's widely used in real code.

swift
import Foundation

// Program စတင် run သည့်အခါ ဒီလိုင်းက console ထဲကို text ထုတ်ပြမယ်။
print("Hello, World!")

Swift reads code top to bottom. In this example, we import Foundation and print a line of text using the print() function.

You should see
Hello, World!

Easy traps

  • Forgetting to close a quote, forgetting to close a parenthesis, or misspelling something are the most common syntax errors beginners run into.
Syntax & Hello World | Thuta Learning