Skip to content

Commit 5baf5c0

Browse files
authored
Update introduction.md
1 parent 25206a3 commit 5baf5c0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

concepts/pairs-and-dicts/introduction.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ julia> length(pv)
5151
A `Dict` is superficially similar, but storage is now implemented in a way that allows fast retrieval by key, even when the number of entries grows large.
5252

5353
```julia-repl
54-
julia> pd = Dict(pv)
54+
julia> pd = Dict('a' => 1, 'b' => 2, 'c' => 3)
5555
Dict{Char, Int64} with 3 entries:
5656
'a' => 1
5757
'c' => 3
@@ -84,9 +84,15 @@ Most importantly, this means the `key` must be _immutable_, so `Char`, `Int`, `S
8484

8585
### Modifying a Dict
8686

87-
Entries can be added with a new key or overwritten with an existing key.
87+
Entries can be added, with a new key, or overwritten, with an existing key.
8888

8989
```julia-repl
90+
julia> pd
91+
Dict{Char, Int64} with 3 entries:
92+
'a' => 1
93+
'c' => 3
94+
'b' => 2
95+
9096
# Add
9197
julia> pd['d'] = 4
9298
4

0 commit comments

Comments
 (0)