Thanks for this write up. I didn't know about enumerate. I never thought of swapping variables as in example 4 either.
I noticed one small mistake in section 9:
d[keys] = values[i]
Should be: d[key] = values[i]