

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 7
click for more info
Not enough gems
Cost: 6 gems
1: Loops in Go
incomplete
2: Omitting Conditions from a for Loop in Go
incomplete
3: There Is No While Loop in Go
incomplete
4: Fizzbuzz
incomplete
5: Continue & Break
incomplete
6: Connections
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Go supports the standard modulo operator:
7 % 3 // 1
The AND logical operator:
true && false // false
true && true // true
As well as the OR operator:
true || false // true
false || false // false
We're hiring engineers at Textio, so time to brush up on the classic "Fizzbuzz" game, a coding exercise that has been dramatically overused in coding interviews across the world.
Complete the fizzbuzz function that prints the numbers 1 to 100 inclusive each on their own line, but replace multiples of 3 with the text fizz and multiples of 5 with buzz. Print fizzbuzz for multiples of 3 AND 5.
This lesson is graded based on the output of your program, so don't leave any debugging print statements in your code.
Example output:
1
2
fizz
4
buzz
fizz
7
8
fizz
buzz
11
fizz
13
14
fizzbuzz