Why does this piece of code work: s~=~"""for~i~in~range(3):\n~~~~x~=~i\n""" exec~s while this one doesn't: s~=~"""for~i~in~range(3):\n~~~~x~=~i""" exec~s I have replaced all the spaces in the code by "~".