Ad
  • Custom User Avatar

    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 ;-)

  • Custom User Avatar

    It would be easier for all if you post your code using proper markdown and marking your post as having spoiler content.

  • Custom User Avatar

    My solution works in IDE/terminal/wherever

    This is never an argument. Cases like yours always end up being a mistake on user's side.

  • Custom User Avatar

    EOF error means that you're most probably missing a parenthesis somewhere.

  • Custom User Avatar

    indirect type conversion

  • Custom User Avatar

    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.

  • Custom User Avatar

    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?

  • Custom User Avatar

    Hint: Do not modify the original array.

    Probably that.

  • Custom User Avatar

    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.

  • Custom User Avatar

    Here your functions should return the expected result, you're printing it inside your function and returning a wrong value. Replace the print for return in that line and when developing your code outside CW, use print(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.

  • Custom User Avatar

    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?

  • Custom User Avatar

    Your code starts like this:

    def create_phone_number():
    

    instead of:

    def create_phone_number(n):
    

    by any chance?

  • Custom User Avatar

    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.

  • Custom User Avatar

    EOFError occurs when you have a parenthesis missing. Also calling input itself could be a problem.