---
title: 12 Days of Christmas
description: Strengthen your coding skills, improve your ability to solve coding problems and learn from kata solutions shared by Codurance craftspeople.
---

[Katas ](https://www.codurance.com/katas)

# [12 Days of Christmas](https://www.codurance.com/katas/12-days-of-christmas)

 Written by [Rowan Lea, Software Craftsperson](https://www.codurance.com/katas/author/rowan-lea) | Dec 3, 2022 9:00:00 AM

The goal of this Christmas themed kata is to print the lyrics to the 'Twelve Days of Christmas' song, with the smallest amount of lines possible.

## Instructions

## Input

You will create a single function where a day number is entered between 1 and 12 (inclusive).

This will then print out the lines for that day.

### Output

The output will always include the day that has been included and all the gifts given on that day.

*For example, if you enter '1' for the first day, then it would print the following verse:*

On the First day of Christmas,   
My true love gave to me:   
A partridge in a pear tree

*And, for day 12, you would output the full lines giving the following verse:*

On the Twelfth day of Christmas,   
My true love gave to me:   
Twelve drummers drumming,   
Eleven pipers piping,   
Ten lords a-leaping,   
Nine ladies dancing,   
Eight maids a-milking,   
Seven swans a-swimming,   
Six geese a-laying,   
Five golden rings,   
Four calling birds,   
Three French hens,   
Two turtle doves,   
And a partridge in a pear tree.

## Tip

Don't worry about capitalisations for this kata

[View full post](https://www.codurance.com/katas/12-days-of-christmas)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Rowan Lea, Software Craftsperson"
  },
  "dateModified" : "2022-12-03T09:00:00.443Z",
  "datePublished" : "2022-12-03T09:00:00Z",
  "headline" : "12 Days of Christmas",
  "image" : {
    "@type" : "ImageObject",
    "height" : 630,
    "url" : "https://3042464.fs1.hubspotusercontent-na1.net/hubfs/3042464/Katalyst/Thumbnails/Katalyst_Thumbnail_12%20days%20of%20Christmas.jpg",
    "width" : 1200
  },
  "mainEntityOfPage" : "https://www.codurance.com/katas/12-days-of-christmas",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60,
      "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
      "width" : 60
    },
    "name" : "Katas"
  }
}
```