I have the following dictionaries in python 3. Both dictionaries have the same key and order, i.e., 'a', 'z', 'foo', 'b'
. But each has a different value.
I confirmed that both key-orders are always same. But does it depend on environments? I know we cannot usually fix the order of keys. I would like to know the key-order of different dictionaries with same keys'
dic1 = {'a': 0, 'z': 2, 'foo': 0, 'b': 0}
dic2 = {'a': 1, 'z': 0, 'foo': 8, 'b': 7}
for k, v in dic1.items():
print(k, v)
for k, v in dic2.items():
print(k, v)