= Dict([("A", 10), ("B", 20)]) x
Dict{String, Int64} with 2 entries:
"B" => 20
"A" => 10
Dictinaries can be created using an iterable of 2-tuples of the form (key, value)
:
= Dict([("A", 10), ("B", 20)]) x
Dict{String, Int64} with 2 entries:
"B" => 20
"A" => 10
Alternatively, a series of pair arguments can be used:
= Dict("A" => 10, "B" => 20) x
Dict{String, Int64} with 2 entries:
"B" => 20
"A" => 10
To specify types:
= Dict{String, Float64}("A" => 10, "B" => 20) x
Dict{String, Float64} with 2 entries:
"B" => 20.0
"A" => 10.0
= Dict(
x "A" => [3, 5, 7],
"Meta" => Dict(
"ID" => "super",
"Origin" => "345"
)
) x
Dict{String, Any} with 2 entries:
"Meta" => Dict("Origin"=>"345", "ID"=>"super")
"A" => [3, 5, 7]