I have the following scenario where most of my functions require to return different things based on a condition.
def get_root_path(is_cond_met=False): if is_cond_met: return "something" else return "something else" def get_filename(is_cond_met=False): if is_cond_met: return "file name A" else return "file name B"
is_cond_met is going to be common for all the functions I am calling. I have just put two here however I have more than 15.
The above code works, however, doesn't seem optimal, or pythonic. Is there a better solution for this?