I have this piece of code, which raises an exceptionif there are no numbers from 3 services.I really don't like how it looks at the moment:    no_numbers = Falseif use_verizon_sms:  if not Api.check_avalible_credits():    no_numbers = Trueelif use_verizon:  if not buy_verizon_number():    no_numbers = Trueelse:  if not check_count_numbers():    no_numbers = Trueif no_numbers:  raise Exception(THERE IS NO AVAILABLE NUMBERS)A shorter version looks even more ugly to me and less clear: if (use_verizon_sms and not Api.check_avalible_credits()) or \  (use_verizon and not buy_verizon_number()) or \  not check_count_numbers():  raise Exception(THERE IS NO AVAILABLE NUMBERS)Do you have any ideas how to rewrite it?
Very long If Statement in Python
python
Have a look whether you can extract the code into a function. It then may look like this.def has_no_numbers():  if use_verizon_sms:    return not Api.check_avalible_credits()  if use_verizon:    return not buy_verizon_number()  if not check_count_numbers()    return True  raise Exception(THERE IS NO AVAILABLE NUMBERS)