xxxxxxxxxx
my_new_dic = { 'England': 435, 'France': 12, 'Egypt': 31 }
new_tup = [(key, value) for key, value in my_new_dic.items()]
print(new_tup)
xxxxxxxxxx
dictionnary = {}
dictionnary[(0, 0)] = 0
dictionnary[(1, 0)] = 4
dictionnary[(1, 1)] = 5
dictionnary[(0, 1)] = 88
print(dictionnary)
xxxxxxxxxx
'''
Dictionaries need hashable data as key.
Lists are not hashable so you can't use them as a key.
Tuples are hashables.
A way to do is to convert list to tuple before using them as a
dictionary key
'''