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 trialjosh hahn
5,926 PointsI have no idea what I am doing wrong here
I have no idea what I am doing wrong here
let movieDictionary = ["Spectre": ["cast": ["Daniel Craig", "Christoph Waltz", "LÊa Seydoux", "Ralph Fiennes", "Monica Bellucci", "Naomie Harris"]]]
var leadActor: String = ""
// Enter code below
if let movie = movieDictionary["Specter"], let movieCast = movie["cast"]{
leadActor = movieCast[0]
}
1 Answer
Jennifer Nordell
Treehouse TeacherHi there! You're either going to love or hate this answer. Your syntax and logic are spot on. You're doing the if let
like a pro! So kudos!
It's your spelling that's a little off. You're getting the movieDictionary
for the movie "Specter", but you should be getting it for "Spectre". Note the reversal of the "r" and the "e" in the movie title.
Hope this helps!
josh hahn
5,926 Pointsjosh hahn
5,926 Pointsdangit I hate it when I make silly stupid mistakes