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 trial

iOS Swift Basics (retired) Collections What is a Dictionary?

I need help with this code challenge please? Assign the value for key "UK" to a constant named ukCurrency.

It seemed simple and I entered in;

let ukCurrency = "UK"

And then I even tried it with the brackets [].

But still nothing, I need help.

dictionaries.swift
let currencies = [ "US": "Dollar", "UK": "Pound", "JP": "Yen" ]

let ukCurrency = ["UK"]

It's okay everyone, I figured it out. Maybe next time I need to read a little slower. Lol! Thanks!!

6 Answers

I just answered it myself.

Abdurahman Sharif
Abdurahman Sharif
1,205 Points

im stuck on this too. how did you solve it

Hey, read it carefully a couple times more and if you still can't get it let me know and I'll help some more. I want you to figure it out first because with programming it's all about debugging and thinking. So read it slowly a couple more times and you'll get it.

Abdurahman Sharif
Abdurahman Sharif
1,205 Points

lol. ya your right.. silly question. i was just focused on the wrong word. but i figured it out. thanks!!

Hey you're welcome and great job figuring it out.

Abdurahman Sharif
Abdurahman Sharif
1,205 Points

feels so good when you get it

Bachir Kurdi
Bachir Kurdi
10,098 Points

Hello i can't see the problem here could i get some help please.

Bachir Kurdi
Bachir Kurdi
10,098 Points

haha i just figured it out