Dictionary issues

I would like to know what is wrong in my dictionary and how can I print it? :open_mouth:

-- What's wrong in my dictionary?
local my_first_Dictionary = 
{  
    key= "first_Key" value= 666555,
    key= "second_Key" value= 111333
}

print()-- → i need print this dictionary here..
local my_first_dictionary = {
    first_key = 666555,
    second_key = 111333
}

for key, value in pairs(my_first_dictionary) do
    print(key, value)
end
1 Like

you’ve got the syntax a bit off.

local dict = {
    first_key = 666555,
    second_key = 111333
}

print(dict.second_key)
1 Like

Thanks a lot guys! I think I got confused when I wrote everything :sweat_smile:

1 Like

The dictionary has to values in one line, I suggest you make separate dictionaries for each “key”.

local dictionary = {
    key1 = {
        key = "first_key";
        value = 666555
    },
    key2 = {
        key = "second_key";
        value = 111333
    }
}

To print it, you should use a pairs loop.