Dynamic Programming Examples Python