Menu
Coddy logo textTech

Diamond Pattern

Lesson 6 of 24 in Coddy's Golang Challenges - Level 1 course.

challenge icon

Challenge

Easy

Write a function that takes a number as input and prints a diamond pattern with the numbers increasing from 1 to the input number.

Example: If the input is 5, the output should be:



    1
   1 2
  1 2 3
 1 2 3 4
1 2 3 4 5

Try it yourself

import "fmt"
func printDiamondPattern() {


}

All lessons in Golang Challenges - Level 1