Go exercises — Beginner

Beginner Go exercises with solutions: first programs, conditionals, loops and simple manipulations, each with a statement and a full solution.

Beginner

Easy10min

Hello World in Go

Write your first Go program that prints Hello, World to the terminal, then compare your solution with a complete, tested example.

  • fmt
  • package main
Easy12min

Even or odd in Go

Read an integer and print whether it is even or odd using the modulo operator, then check your logic against a complete tested Go solution.

  • conditions
  • modulo
Easy15min

FizzBuzz in Go

Print the numbers 1 to 100, replacing multiples of 3 with Fizz, of 5 with Buzz and of both with FizzBuzz, with a complete tested Go solution.

  • conditions
  • boucles
Easy12min

Multiplication table in Go

Print the full multiplication table of a number from 1 to 10 with a for loop, then compare your code with a complete tested Go solution.

  • boucles

← See all exercises · Review the lessons

Search

Search runs entirely in your browser.