I am using random.choice() to randomly call functions in a list. It works ok but sometimes one of the criteria in the called function is not met so it does not run. When this happens I would like to call another, different function from the list.
func_list is populated dynamically and there may be one or multiple functions in the list.
Here's the code:
func_list[func_one, func_two, func_three]
random.choice(func_list)()
So, for example, say func_two was called but criteria in the function was not met I would like to call either func_one or func_three chosen at random. If the criteria in that function is not met I would like to call the other one.
Is it possible to do this?