xor.py: more comments, more verbous output

Hello Prof Schles,

do you accept pull requests?  

I tried to make the code of xor.py a bit more readable,
without changing too much.