Weird Fix Your Code Pop Up


#1

#will I wrote this on level ‘Pesky Yaks’

and

#but then I get this eror saying

#and I don’t know what is happening it doesn’t highlight a line red or anything this just pops up can you fix it? or tell me how to?


#2

#FWI the code still runs but they player doesn’t do anything


#3

Well, perhaps it has to do with the many errors in your function. Let’s go through them one by one.

In the line def removeByType(list, excludedType):, you try to use a variable list. However, list is already a data type in Python. Therefore, you cannot use it as a variable.

The next line with an error on it says if enemy = excludedType():. There are several things wrong with this. First, you are checking the enemy itself, not its type. Next, you did not use two equal signs for comparison. Finally, you tried to call excludedType as a function.

The last error is on the line tempList(removeByType). You’re supposed to be appending enemy to the list using append. Your command, however, does not make any sense.


#4

thanks I didin’t know that but if I change it to

It tells me that it’s not a function

and the

is there when you first open it why is it there if it doesn’t work


#5

I told you that you tried to call excludedType as a function, but it isn’t. Remove the pair of parentheses.

Never mind, the list variable works.