It's not very Pythonic to put if-else statements all on one line like this. Please expand these out.