Modifying mutables during looping over them is considered dangerous. 

What you're trying to check here is if a platform was supplied that's not in allowed_platforms. But you're only cleaning up the name after the `... in allowed_platforms` check. 

Can this all be replaced with a list comprehension and a simple set operation to find the compliment?