Hello World
Part of the Fundamentals section of Coddy's GO journey — lesson 2 of 109.
The "Hello, World!" is a simple program that outputs Hello, World! to the screen.
In Go, we use Println() to show words on the screen. The words go inside quotation marks.
Let's take a look at the "Hello World!" program in Go:
fmt.Println("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:
fmt.Println("Hello, World!")fmt.Println("hello, world!")are different things (notice the capital letters in the first line).
Cheat sheet
To print in the console use fmt.Println():
fmt.Println("Hello, World!")Try it yourself
package main
import ("fmt")
func main() {
// TODO: Use fmt.Println() to print "Hello, World!" below
}This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
4Comparison & Logical Operators
Comparison Operators - Part 1Comparison Operators - Part 2Logical AND OperatorLogical OR OperatorLogical NOT OperatorOperator Precedence BasicsRecap - Making Comparisons7Control Flow: Loops
What The `for` Loop ExplainedFor Loop - BasicFor Loop - Condition OnlyThe `break` KeywordThe `continue` KeywordNested LoopsRecap - Repeating Actions2Variables and Basic Data Types
What is a variableType Inference with `:=`Integers (int)Floating-Point NumbersBooleansStringsZero ValuesConstantsNaming ConventionsRecap - Variables and Types5Basic Input/Output
Formatted OutputFormat VerbsPrinting TypesGetting Basic User InputRecap - Input and Output8Functions
Understanding FunctionsDeclaring a FunctionCalling FunctionsFunction ParametersReturning a Single ValueReturning Multiple ValuesNamed Return ValuesFunction Scope BasicsRecap - Creating Reusable Code3Basic Operators
Arithmetic OperatorsDivision OperatorThe Modulo OperatorAssignment OperatorAugmented Assignment OperatorsIncrement and DecrementRecap - Calculations6Control Flow: Conditionals
The `if` StatementThe `else` KeywordThe `else if` KeywordVariable Shadowing in `if`Initializing VariablesThe `switch` StatementSwitch with ExpressionsSwitch without ExpressionThe `fallthrough` KeywordRecap - Making Decisions