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

  • Default User Avatar

    Why is it showing me different results as I am further indenting print(x) or return x, anybody knows the answer?

  • 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

  • Default User Avatar

    Instructions are unclear and vague:

    "magic_ - a special property as it should be able to handle numbers given with it" should write "magic_ - special instance
    and its property is being able to handle numbers given with it"and since it has and underline its not a public but private instance.
    "whereami" is also instance and "whoami" is also instance.

  • 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.

  • Default User Avatar

    It doesnt work fine as it gives error that you cannot call a string with string, it has to be an integer so either that string in square bracket "status" has to be converted to integer or removed completeley. Then it works fine as I have proven it by deleting it in sample test but it shows up again in the hidden full test to which we have no
    access. I will skip this kata.

  • 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.

  • Default User Avatar

    It is giving me an error for the test code itself.

  • Default User Avatar

    Unexpected exception raised

    Traceback (most recent call last):
    File "/workspace/default/.venv/lib/python3.10/site-packages/codewars_test/test_framework.py", line 112, in wrapper
    func()
    File "/workspace/default/tests.py", line 11, in start_with_one
    test.assert_equals(stringy(10)[0],'1',"Whoops your string doesn't start with a '1'")
    TypeError: 'NoneType' object is not subscriptable

  • Custom User Avatar

    What's misleading? Do you have a better one?

  • Custom User Avatar

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

    Python Completions 2825

    It works fine.

  • Default User Avatar

    I have tried to fix the code by deleting string status in the square brackets before the string busy in the sample code and test worked fine but I cannot
    change the code in the hidden test as I got permission denied, therefore this kata is not working fine.

  • Default User Avatar

    I fixed it by deleting "status" string in sample tests but apparently status string in square brackets is in the full test code which we cannot see.

  • Default User Avatar

    I would suggest that you google what you need to do currently with the assignment instead of learning theory of the program as you dont need the theory if the task does not require it. Thats the way I am learning Python.

  • Loading more items...