Update removevalue.py

Removing items while iterating was a bug. Fixed by using filter and set operations.