You can use conditional expressions like this
("NORTH " if b > 0 else "SOUTH ") + ("EAST" if a > 0 else "WEST")
There is one more hack which can be used here
["SOUTH ", "NORTH "][b > 0] + ["WEST", "EAST"][a > 0]
This works because, in Python boolean values are actually integers. The following are true in Python
print 1 == True
# True
print 0 == False
# True