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 trialoliver yuan
Courses Plus Student 827 Pointschallenge task 2 from associated value
The question is create a variable named book and assign it an instance of BookType.PDF with an associated value of "Game of Throne"
i wrote: var book = BookType.Pdf("Game of Thrones") but it doesnt seems to work, did i misunderstand the question? someone please help me thanks.so much!
oliver yuan
Courses Plus Student 827 Pointsthanks very much!! i will try that.
3 Answers
Alan Ng
13,368 Pointsvar book = BookType.Pdf("Game of Thrones")
I dont see any difference between your code and mine. did you pass the task 1? try copy & paste my code see if you can pass it
Joylyne Mangezi
2,632 Pointsvar book = BookType.Pdf case Game of Thrones
Erbey Ortiz
Courses Plus Student 1,085 Pointsenum BookType { // Write your members with associated values here case Pdf(String) case Epub(String)
} var book = BookType.Pdf("Game of Thrones")
Michael Cobb
2,166 PointsMichael Cobb
2,166 PointsMake sure you are writing the code outside of the curly braces. The code looks good.