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.
bumsfeld
Nearly a Posting Virtuoso
1,445 posts since Jul 2005
Reputation Points: 404
Solved Threads: 184