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 Bradford
9,935 PointsCan't figure out why I am not getting this code right, can anyone help? I am suppose to assign value for key to constant
I believe I have the code correct but it is not passing me through. It keeps giving errors. Has anyone had this same problem? Any help would be great, thanks in advance.
let currencies = ["US": "Dollar", "UK": "Pound", "JP": "Yen"]
let ukCurrency = currencies.removeValueForKey("UK")
1 Answer
José Manuel Martínez López
18,133 PointsukCurrency=currencies["UK"]
José Manuel Martínez López
18,133 PointsJosé Manuel Martínez López
18,133 PointsI do not have xcode open, but i belive is like that.
Josh Bradford
9,935 PointsJosh Bradford
9,935 PointsIt worked like a charm, man, thank you so much for the help!
arnavthecoder
3,453 Pointsarnavthecoder
3,453 PointsJust like you said. When retrieving a value from a dictionary, use this example: ``` let greeting: String = ["Hello": "Formal", "Hey": "Irrformal"] let formal: String = greeting["hello"]