You need to give more details of what you want to accomplish.
At first look, there are quite a few errors in your code. Your indentations are a mess (they are not cosmetic, they actually form statement blocks in Python!), if needs == as comparison operator, for needs colon at the end of line, and pruned_new has to be initiated as empty list.
Reputation Points: 404
Solved Threads: 180
Nearly a Posting Virtuoso
Offline 1,422 posts
since Jul 2005