Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Kyle DuFrene
4,217 PointsWhat am I doing wrong here?
Here is the question: "Let’s assume we want to create a model to represent a box of chocolates. The chocolate box will contain dictionary instances that stores information about different kinds of chocolates. To start, create a struct named ChocolateBox." I am not sure what I am doing wrong or if I am completely doing the wrong thing. Thanks!
struct ChocolateBox {
let carmelDelight: String = [["flavor": "caramel"]]
}
3 Answers

Chris Stromberg
Courses Plus Student 13,389 Points// First part of challenge just make the struct
struct ChocolateBox {}
// For the second part of challenge you need to add a dictionary (Key Value paring).
struct ChocolateBox {
var caramelDelight = ["flavor": "caramel"]
}
// In your code the syntax was wrong. You told the compiler that you were creating a String
// when you were actually creating a Dictionary. You also had some extra brackets.
let carmelDelight: String = [["flavor": "caramel"]]

Kyle DuFrene
4,217 PointsThanks!

Caleb Kleveter
Treehouse Moderator 37,862 PointsYou don't need to specify a string, and I'm not sure if you need to change it to a variable but you only need one set of brackets, not two.
var carmelDelight = ["flavor": "caramel"]

Kamil Wrobel
5,546 Pointsthis works, it just have a typo instead of "carmelDelight", you need to write "caramelDelight"