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 trialNikolaos Ntemos
3,271 PointsIs this a bug?
I am trying to complete Task 2 on the Dictionaries Section but i don't now what is the matter with this code:
let currencies = ["US" : "Dollar", "UK" : "Pound", "JP" : "Yen"]
let ukCurrency = currencies
ukCurrency["UK"]
I xcode everything seems fine.
Is this a bug?
let currencies = ["US" : "Dollar", "UK" : "Pound", "JP" : "Yen"]
let ukCurrency = currencies
ukCurrency["UK"]
2 Answers
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsYour code runs, it's just not accomplishing the outcome that the challenge wants. They want you to put the just value of the UK currency inside the constant ukCurrency. You're putting the whole dictionary (all the currencies) into ukCurrency. Try this:
let currencies = ["US" : "Dollar", "UK" : "Pound", "JP" : "Yen"]
let ukCurrency = currencies["UK"]
Nikolaos Ntemos
3,271 PointsThank you ! That was the point :-)