Go exercises

Practise with solved Go exercises, from beginner to advanced, each with a statement, hints and a detailed 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

Intermediate

Medium20min

Calculator in Go

Build a small integer calculator that returns a result or an error for each operation, then compare it with a complete tested Go solution.

  • fonctions
  • erreurs
Medium20min

Word counter in Go

Count how many times each word appears in a text using strings and a map, then compare your program with a complete tested Go solution.

  • strings
  • maps

Search

Search runs entirely in your browser.