The else clause matches an if at the same level of indentation as expected.
The problem you see may be due to the fact that you are mixing tabs and spaces, so the apparent level of indentation is different from what your interpreter sees.
Change all tabs to spaces and check if the problem persists.
source share