strategy pattern def strategy_subtraction(arg arg )return arg arg def main()print(executor( )print(executor( strategy_addition)print(executor( strategy_subtraction)if __name__ ="__main__"main(once againwe test that the code results in the output we saw throughout this strategy not implemented - indeed it does now we have cleanclearand simple way to implement different strategies in the same context the executor function now also uses an early return to discard invalid stateswhich makes the function read more easily in terms of the actual execution of the optimal case happening on single level in the real worldyou might look at using different strategies for evaluating the stock market and making purchasing decisionsalternativelyyou might look at different pathfinding techniques and switch strategies there parting shots the broken windows theory works just as well in code as in real life never tolerate broken windows in your code broken windowsin case you were wonderingare those pieces of code that you know are not right and will not be easy to maintain or extend it is the type of code you really feel like slapping todo comment onthat you know you need to come back and fix but never will to become better coderyou need to take responsibility for the state of the codebase after you have had it in your careit should be bettercleanerand more maintainable than before next time you feel the temptation to leave to-do as booby trap for the poor developer who passes this way after youroll