Ad
  • Default User Avatar

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

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

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

  • 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

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

  • Default User Avatar

    its a tuple which you have to convert into a string. just put in print(type(object that you want to check)) and it will tell you
    whether its a integer, string or a tuple.

  • Default User Avatar

    strings is everything that is in quotation marks like these ones "", they are of green colour in your code. Integers are numbers, they are of orange colour and you can compute with them or compare them against each other. functions are dark purple, they are commands to python to do something with the data supplied to it.
    If you put numbers in "" marks they become strings as they become green in colour.

  • Default User Avatar

    I am trying to print log of my code for debugging but when I test the print function the end result that I get is unauthorized, can we not follow what is happening with our code line by line?

  • Default User Avatar
  • Default User Avatar

    I think there is something wrong with this kata itself,

    gives me a message that test is passed and then IndexError: Replacement index 2 out of range for positional args tuple.
    How can there be an error if the test is passed and my code does exactly what Kata is looking for?

  • Default User Avatar

    ("True") is me converting boolean value into string True as boolean itself is not iterable per error messages that I got before and then assigning string True to variable sheep and then counting variable sheep as per instructions.

  • Default User Avatar

    My code is returning number of sheeps therefore I get a message that test is passed, how do you mean that my code is not returning anything?

  • Loading more items...