Define And If Function Python