We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Maybe you could help me see where I'm going wrong -- I tried the same basic idea as yours, but instead of using an empty list to cover the pop instances, I used an try--except to get around it.
Trees: Is This a Binary Search Tree?
You are viewing a single comment's thread. Return to all comments →
Maybe you could help me see where I'm going wrong -- I tried the same basic idea as yours, but instead of using an empty list to cover the pop instances, I used an try--except to get around it.
This throws a type error for x[1], saying it needs a number and not a string. But it should already be an int!
If I replace my last eval with "eval('s.%s(int(%r))', ...) it works! (sort of -- I get the wrong sum as the end)