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.
i
in this case is not ideal letter variable as it implies index, becasuse here it is actually a string name being iterated on (inside the lambda function)This comment is hidden because it contains spoiler information about the solution
The letters are in the same order, c is before d and d is before w, etc. You can merge them as I wrote them there.
Please use appropriate markdown formatting when posting code. See https://docs.codewars.com/training/troubleshooting#post-discourse.
See https://docs.codewars.com/training/training-example#debugging-a-kata and https://docs.codewars.com/training/troubleshooting#print-input.
d | other
(cf. https://docs.python.org/3/library/stdtypes.html#mapping-types-dict)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
You are sorting a list containing strings and ints.
<
only works on operands of the same type (unlike e.g. in JavaScript where everything is compared as string by default)Looking at your solution, what was so hard about it?
as a beginer can say that this kata is still hard to those who can solve 4,5 kyu
key=lambda a: (len(a), a) is the sort key, he sorts based on the length of the string first and then on the string itself that means the default sort key when sorting strings (alphabetically)
As the task wants you to start with the longest names and proceed to the shortest and also sort from z-a in case of same length he uses reverse=True to reverse the sort order on both keys
This comment is hidden because it contains spoiler information about the solution
multiply_all([1,2,3])(2)
|
-> integer bitwise or, set union and dict mergehttps://docs.python.org/3/library/stdtypes.html#mapping-types-dict
This comment is hidden because it contains spoiler information about the solution
Loading more items...