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.
it's my first time doing python, and this is quite good for beginners.
Great kata!!🧟♂️
Isn't this pretty much a duplicate of this?
This comment is hidden because it contains spoiler information about the solution
nice! really simple compared to other answers, but I do have a question that I would love if someone could clarify them!
what does the [-2::-1] do exactly?
The term you are looking for I think, is "aliasing"
nothing is shadowed, here, the builtin is just assigned to another name in the current scope, that's all.
I think shadowing a built-in generally refers to asigning a built-in to something else, e.g.
print = lambda x:x+1
This comment is hidden because it contains spoiler information about the solution
Why does this work?
Isn't that just the import syntax or does it somehow return something as well?
Why I do level 8 Kata. :D
One possible answer is given in the docs https://docs.codewars.com/authoring/tutorials/create-first-kata
Basically, there is no easy answer as to how to create a good task. Rather, there is a vast list of "don't's":
As to how come up with original ideas, it's a difficult question. There are different types of katas, and some users come up with ideas more often than others. Consider, for example, math olympics tasks. Such tasks may appear as sudden intermediate step in some math work. Many ideas come from life. Again, as you solve more katas and get more experience, you will know more and you will start notice more things, which in turn will stimulate your imagination further.
I would like to ask how to create a good kata?
If I try the random tests, here is one input I just got:
* 5 / 49 - 21 / 52
with variable =99
If you solve this only using
//
you get answer49504
- this is what your solution expects.If you solve this using
/
you get answer51542.4
which is the valid mathematical solution - it is fully reversible - so you can work backwards and you will get the original input99
:(((51542.4/52) - 21 )/ 49) * 5 = 99
Meanwhile, if I feed back the expected answer 49504 to the equation - because of the repeated use of
//
, I will not get back the input value:(((49504//52) - 21 )// 49) * 5 = 95 <--- NOT 99
I kind of don't understand what you're talking about!
It's really not clear from the description that you are expecting all divisions (in the "reverse process") to be carried out using
floordiv
or//
.Especially as, in your own test cases, you use
/
to refer to the "divisions" that are presumed to have taken place to obtain the result in the "forward process".Also - mini-issue, your random test formula have trailing whitespace (you can remove this with
.rstrip()
to avoid users having to work it out themselves if they process their strings without using regex)Loading more items...