Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKevin Selagea
2,161 PointsCan you help me get rid of this syntax error? I can't seem to get rid of it!
I just can't seem to get rid of this syntax error. Can one of you guys check my code to see if it's good?
def songs = ('songs')
songs = {'Song1', 'Song2', 'Song3'}
set(['songs'])
3 Answers
Thomas McDonnell
8,212 PointsHi Kevin I am not sure what it is you are doing here, I have viewed the challenge and the below is the step by step walk through of how it should be solved.
Hope this helps.
"""
First make the variable songs = to the set {"song1", "song2", "song3"}
"""
songs = {"song1", "song2", "song3"}
"""
Than use the add() funtion to add the song "Treehouse Hula" to the songs set
"""
songs.add("Treehouse Hula")
"""
Than use the update() function to update your set with the following two sets {"Python Two-Step", "Ruby Rhumba"}{"My PDF Files"}
"""
songs.update({"Python Two-Step", "Ruby Rhumba"}{"My PDF Files"})
Steven Parker
231,261 PointsIt looks like you're working on task 1, but only line 2 relates to the task 1 instructions. The other lines aren't needed, and also cause a syntax error.
Thomas McDonnell
8,212 PointsOps sorry I have an awful habit of forgetting about mark down.
Steven Parker
231,261 PointsYou can always edit your answer.
Michael Ogobamidele
Courses Plus Student 1,514 PointsJust make a change like this
songs.update({"Python Two-Step", "Ruby Rhumba"}, {"My PDF Files"})
Steven Parker
231,261 PointsSteven Parker
231,261 PointsWhen posting code, use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area. Or watch this video on code formatting.