Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+7 votes
asked in old_CSC201 by (1 point)

1 Answer

+2 votes

Since there are a couple of placed in the game loop that you are removing values, it may be that you have removed something from a list already and then try to again.

The in operator can be used to check to see if something is in a list before trying to remove it.

For example:

if (spider in spiderList) and ..... :

 spiderList.remove(spider)

The remover statement would only execute if the spider is in the spiderList avoiding the error mentioned.

answered by (1 point)
...