# Why do I get a key error when using a created symbol?

**URL:** https://discourse.julialang.org/t/why-do-i-get-a-key-error-when-using-a-created-symbol/68001
**Category:** New to Julia
**Created:** [September 10, 2021, 7:25pm UTC](https://discourse.julialang.org/t/why-do-i-get-a-key-error-when-using-a-created-symbol/68001 "2021-09-10T19:25:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cybervigilante](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cybervigilante/32/26687_2.png) [@cybervigilante](https://discourse.julialang.org/u/cybervigilante)
#### Post date: [September 10, 2021, 7:25pm UTC](https://discourse.julialang.org/t/why-do-i-get-a-key-error-when-using-a-created-symbol/68001/1 "2021-09-10T19:25:02Z")

</div>

I thought it would be handy to create Symbols, and that worked, but why do I get a key error when I try to use them in a Dict?

```julia
fim = [Symbol(n) for n in "abcdef"]

6-element Vector{Symbol}:
 :a
 :b
 :c
 :d
 :e
 :f

d = Dict()
for sym in fim
    d[sym]=>14
end

KeyError: key :a not found

```

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [September 10, 2021, 7:30pm UTC](https://discourse.julialang.org/t/why-do-i-get-a-key-error-when-using-a-created-symbol/68001/2 "2021-09-10T19:30:34Z")

</div>

Don’t you want just

```julia
d[sym] = 14

```

(instead of `=>`?) With `=>` you are trying to create a pair that binds `d[sym]` to `14`, but `d[sym]` is not defined.
