u can try this, it is even easier if it is string
new_dic = {}
a = 1
new_dic[a] = {}
b = 2
new_dic[a][b] = {}
c = 5
new_dic[a][b]={c}
type
new_dic[a][b]
>>>'5'
For string
new_dic = {}
a = "cat"
new_dic[a] = {}
b = "dog"
new_dic[a][b] = {}
c = 5
new_dic[a][b] = {c}
type
new_dic["cat"]["dog"]
>>>'5'