Dictionary Initialization and Usage

Maybe Julia thinks it is inconceivable that Freiburg is third??

The actual answer is:

julia> x = Dict{String, Int64}
Dict{String, Int64}

julia> typeof(x) # x is not a Dict!
DataType

you have not instantiated a Dictionary, but rather assigned the value Dict{String, Int64}, which is a type, to the binding bundesliga_table_position.

The error is telling you that you cannot add an entry to a DataType. To instantiate an object of a type, use parentheses:

julia> x = Dict{String, Int64}()
Dict{String, Int64}()

julia> typeof(x) # x is a Dict now!
Dict{String, Int64}

julia> x["a"] = 1
1

julia> x
Dict{String, Int64} with 1 entry:
  "a" => 1
2 Likes