Ad
  • Custom User Avatar

    print() displays the output to console, so you will see it at the left panel displayed. But there should be an equivalent code like None should equal ... just below the message because you did not return anything back to the function caller, so the value is None. If you had both print() and return OTOH, the output will be smtg like: (if your code fails)

    "This is the message you've printed"
    "your result" should equal "expected result"
    

    Otherwise, ...

    "This is the message you've printed"
    * Test Passed # green button
    
  • Custom User Avatar

    OP solved it, closing

  • Custom User Avatar

    The tests (depending on the language) use boolean and other kind of values than can be coerced to booleans, that's why the ish is added there, it could be used Truthy instead. Removed boolean from description and used truthy instead.

  • Custom User Avatar

    vocabulary.com says "Words ending with the suffix -ish are often adjectives, but this suffix has several senses. The suffix -ish is flexibly used with a base word to denote 'somewhat, somewhat prone to, or somewhat like.'"

    Booleans are not somewhat true

  • Custom User Avatar

    You have passed the kata, you know you can forfeit a kata to see solutions don't you? I hope you understood the kata was fine.

  • Custom User Avatar

    Not a kata issue, your function isn't always returning a string.

    Before creating an issue, please, check the kata's Details and see how many solution are for your language:

    Python Completions 7232

    With that many, there is almost no chance the problem is in the kata.

  • Custom User Avatar

    No, that's not what you should be doing at all, not a kata issue.

    Python Completions 2825

    It works fine.

  • Custom User Avatar

    No, that's a problem with your code, the number of arguments is not fixed to 3, see the sample tests.

  • Custom User Avatar

    No, it doesn't work like that at all, you're comparing a tuple of one element to a list and doing nothing with that. To avoid frustration, I'd suggest you review how to loop through a list, and follow from there. Read the docs, programming isn't typing random code until it works. Sorry if that sounds harsh, but your code doesn't make sense right now.

  • Custom User Avatar

    When I posted my reply, your code had a print, not a return, and what is this? ("True") == sheep

    Read the error message:

    TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'
    

    And from the kata's description:

    Hint: Don't forget to check for bad values like null/undefined

    Print the input to debug your code.

  • Custom User Avatar

    Python Completions 40435

    Please don't raise issues so lightly. Issues are problems with the kata itself, not a problem with your code. Read this: https://docs.codewars.com/training/troubleshooting/ your function isn't returning anything.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    That solution isn't broken, yours is. You copied and pasted the code and didn't even look at the argument's name (it's different). Look at that whole solution again.

    def bool_to_word(boolean):
      ... bool ... # it sould be boolean here too, not bool
    
    or 
    
    def bool_to_word(bool): # bool here
      ... bool ... 
    
  • Custom User Avatar

    @anthono your code accepts an input called boolean but then you later use a (nonexistant) variable called bool, which is why your code is broken. There is nothing wrong with the kata.

  • Loading more items...