I need to make a two dimensional dictionary in python. e.g. new_dic[1][2] = 5
When I make new_dic = {}, and try to insert values, I get a <
Here is a dictionary that contains another dictionary as the value for key 1:
>>> new_dic = {}
>>> new_dic[1] = {2:5}
>>> new_dic
{1: {2: 5}}
The problem that you had with
new_dic={}
new_dic[1][2]=5
is that new_dic[1] does not exist, so you can't add a dictionary (or anything for that matter) to it.