I have dictionary dict
like this, with tuples as keys:
dict = { (1, 1): 10, (2,1): 12}
and tried to access it like this :
new_dict = {}
for key, value in dict:
new_dict["A"] = key[0]
new_dict["B"] = key[1]
new_dict["C"] = value
But it fails, since key
does not seem to resolves to a tuple. What is the correct way?