Coding for All
Intro to Go

Intro to Go

Beginner About Go →

The := shortcut, slices, range loops and functions. 25 bite-size lessons.

0 / 25 lessons complete
Start Lesson 1
1
Hello, World!
Make the computer say hello, every programmer's first program.
2
Variables with :=
Create a variable the Go way.
3
Numbers
Store numbers and add them together.
4
The Division Surprise
Try the maths operators and meet integer division.
5
Joining Strings
Glue two pieces of text together with +.
6
Printing Several Things
Mix text and variables in one line, the Go way.
7
Booleans
Create a true/false value.
8
If Statements
Only run code when a condition is true.
9
Else
Do one thing when true, another when false.
10
Else If
Check several conditions, one after another.
11
The OR Operator
Combine conditions with ||.
12
The AND Operator
Combine conditions with &&.
13
Slices
Store several values in one variable.
14
Indexes and len
Pick single items out of a slice.
15
Growing Slices
Add to a slice with append.
16
Range Loops
Visit every item in a slice, one by one.
17
Counting Loops
Loop a set number of times with a counter.
18
Range with Positions
Use both things range gives you.
19
Adding It Up
Total up all the numbers in a slice.
20
While, Go-style
Count down to lift-off using for!
21
Break
Escape from a loop with break.
22
Continue
Skip one trip around a loop with continue.
23
Functions
Write your own function and call it twice.
24
Inputs and Return
Give a function inputs and get an answer back.
25
Roll a Six
Grand finale: keep rolling a dice until you get a 6.