Dictionaries

Other topics

Using Dictionaries

Dictionaries can be constructed by passing it any number of pairs.

julia> Dict("A"=>1, "B"=>2)
Dict{String,Int64} with 2 entries:
  "B" => 2
  "A" => 1

You can get entries in a dictionary putting the key in square brackets.

julia> dict = Dict("A"=>1, "B"=>2)
Dict{String,Int64} with 2 entries:
  "B" => 2
  "A" => 1

julia> dict["A"]
1

Contributors

Topic Id: 9028

Example Ids: 28041

This site is not affiliated with any of the contributors.