You can use conditional expressions such as
("NORTH " if b > 0 else "SOUTH ") + ("EAST" if a > 0 else "WEST")
There is another hack that can be used here.
["SOUTH ", "NORTH "][b > 0] + ["WEST", "EAST"][a > 0]
, Python . Python :
print 1 == True
print 0 == False