Skip to content

Instantly share code, notes, and snippets.

@rpearce
Last active August 27, 2015 02:36
Show Gist options
  • Save rpearce/959cea8812213b3fd624 to your computer and use it in GitHub Desktop.
Save rpearce/959cea8812213b3fd624 to your computer and use it in GitHub Desktop.
Songs Iteration and CSV Writing Challenge
songs = [
{
id: 1,
title: "Mother",
author: "Pink Floyd",
album: "The Wall"
},
{
id: 2,
title: "Since I've been Loving You",
author: "Led Zeppelin",
album: "Led Zeppelin III"
},
{
id: 3,
title: "Re: Stacks",
author: "Bon Iver",
album: "For Emma, Forever Ago"
},
{
id: 4,
title: "Von",
author: "Sigur Rós",
album: "Hvarf-Heim"
}
]
# Your task is to iterate over each song
# hash and write the files to a CSV file
# called `songs.csv`.
# The songs.csv file should have a header
# and should contain the following:
#
# id,title,author,album
# 1,Mother,"Pink Floyd","The Wall"
# 2,"Since I've been Loving You","Led Zeppelin","Led Zeppelin III"
# 3,"Re: Stacks","Bon Iver","For Emma, Forever Ago"
# 4,Von,"Sigur Rós","Hvarf-Heim"
#
# your code here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment