Ad
  • Default User Avatar
  • Custom User Avatar

    Fixed, sorry for the mishap, but it happens when I want to be so dumb to try different approaches in different languages just for the sake of having a bit more fun^^'.

    While I was at it, I also approved this good kata :)

  • Custom User Avatar

    Found the problem. Python tests are mistaken. Will add a reply to Translator's comment.

  • Custom User Avatar
    Random tests
    Testing for 'baal World What if Think squad what'
    Traceback:
       in 
       in 
    TypeError: gym_slang() takes exactly 1 argument (2 given)
    

    As shown, when testing with random inputs, a second argument is being passed, and the default function declaration of

    def gym_slang(phrase):
    

    fails.

    I captured the second argument and printed it, I got the following result:

    Random tests
    Testing for 'What world babylon Hello Combination I am world do not instagram world probably fake Fake Hello World gym babel'
    ()
    ([['i am', "i'm"], ['instagram', 'insta'], ['do not', "don't"], ['going to', 'gonna'], ['combination', 'combo']],)
    Test Passed
    Testing for 'Lorem Ipsum world baal Baal my crush Think Going to Crush wait Going to'
    ()
    ([['i am', "i'm"], ['instagram', 'insta'], ['do not', "don't"], ['going to', 'gonna'], ['combination', 'combo']],)
    Test Passed
    Testing for 'Do not was combination squad Lorem hello Probably If instagram Do not Do not Squad Hello wait hello Hello Probably Gym'
    ()
    ([['i am', "i'm"], ['instagram', 'insta'], ['do not', "don't"], ['going to', 'gonna'], ['combination', 'combo']],)
    Test Passed
    

    Hope this helps!

  • Default User Avatar

    Hello LucasSimpson,

    May you please provide some more detail as to when and where the second argument is passed? Thank you very much.

    If you don't mind, I will also be marking this issue as Resolved as passing in extra arguments does not affect how the function behaves anyway since the description makes it very clear that the function should only deal with one argument.

    Cheers,
    donaldsebleung

  • Custom User Avatar

    Some of the test cases pass an unexpected second argument to the function. The second arguments are not used, and it's easy enough to grab them with *args and then ignore them, but it shouldn't be passed in the first place.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    All you really need to do is setup

    class Node (object):
      pass