if and only if statement python