Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Because if your code is returning the wrong result, your code's returning the wrong result. Almost no languages changes behaviour very significantly for the same language version just because the runner environments is configured differently (there are some edge cases, but it's usually very hard to stumble on them accidentally), and especially, not Python. Blaming everyone else for your mistake is very likely to be wrong, and you'll end up making yourself look bad after ;-)
It would be easier for all if you post your code using proper markdown and marking your post as having spoiler content.
This is never an argument. Cases like yours always end up being a mistake on user's side.
EOF error means that you're most probably missing a parenthesis somewhere.
indirect type conversion
I think it is what Chrono said.
I tried using the .remove method first and it passed the tests and failed the random. Then I changed to another method and managed to pass in everything.
Same here.
I even tried the code, with different values, on Repl.it and it gave me the right answer each time. Maybe a bug or something like it?
Probably that.
The problem was basically you were printing something and returning something else. Printing before the return line is ok, because the other way is not possible.
Here your functions should return the expected result, you're printing it inside your function and returning a wrong value. Replace the
print
forreturn
in that line and when developing your code outside CW, useprint(your_function_name(some_argument))
so when you copy/paste your code you don't need to change it here.PS: check again the markdown link I told you, you code loose indentation (and other things) if you don't use it here. Make sure you put all the code inside the two set of backtics.
Instead of having us guessing what's wrong, why don't you post your code using proper markdown and marking your post as having spoiler content?
Your code starts like this:
instead of:
by any chance?
Python usually throws this error when it reaches the end of the code but thinks that it should still be executing a loop or function. I would start by checking the code for any stray whitespace or indentation differences that don't need to be there, or if there are any missing closing brackets, colons, etc that may have disappeared when you pasted your code.
EOFError occurs when you have a parenthesis missing. Also calling
input
itself could be a problem.