Case When Function In Python Syntax Error