For example, I want to swap the two items in the list:
a = ['h','e']
a[a.index('h')], a[a.index('e')] = a[a.index('e')], a[a.index('h')]
but this doesn't seem to do anything. On the other hand
a[0], a[1] = a[1], a[0]
works. So why the discrepancy?