Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Why is it showing me different results as I am further indenting print(x) or return x, anybody knows the answer?
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.
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.
It is giving me an error for the test code itself.
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
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.
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.
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.
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.
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.
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?
Yes, my mistake.
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?
("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.
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...