How to solve Fizz Buzz with Go, Python and PowerShell

I have always heard about FizzBuzz but was not really sure what it was. After some research it seems that FizzBuzz is pretty common interview question for Software Developers even though it is a children’s game.

The question goes like this:

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print Buzz. For numbers which are multiples of both three and five print FizzBuzz.

I am in Dev/Ops week in the AWS loft NY (2/22/2017) and I challenged myself to see in how many programing languages I was able to solve FizzBuzz before the first speaker finish. BTW he was talking about CHEF and AWS Opsworks and I am pretty familiar with those two technologies so no loss there.

So, it took me a little less than 30 minutes to write the solution in Go, Python and PowerShell. These are the solutions


package main
import "fmt"
import "math"
import "time"
func main() {
for i := 1.0; i < 101; i++ {
switch {
case math.Mod(i,3) == 0 && math.Mod(i,5) == 0:
fmt.Println("Fizz Buzz")
case math.Mod(i,3) == 0:
case math.Mod(i,5) == 0:

view raw


hosted with ❤ by GitHub


for number in range(1,101):
    if number % 3 == 0 and number % 5 == 0:
    elif number % 3 == 0:
    elif number % 5 ==0:


ForEach ($number in (1..100)) {

    if($number % 3 -eq 0 -and $number % 5 -eq 0){

    elseif ($number % 3 -eq 0) {
    elseif ($number % 5 -eq 0){


Finally, if you are reading this now you can see how to solve FizzBuzz in different languages and try to solve on you prefer language. The key to solve the problem is by using the modulus operator

2 Replies to “How to solve Fizz Buzz with Go, Python and PowerShell”

  1. Wow you’ve been programming a lot since we first met! Kudos to you sir glad to see you’re liking it, keep up the good work.


Leave a Reply to Gabe Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s