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.
the sum of the differences of 7 and 1, dude :-)
This comment is hidden because it contains spoiler information about the solution
I didn't realize
print()
returnsNone
. Thank you!The
print()
function returnsNone
. You are printing that return value.That's because
print()
has nothing to return; its job is to write the arguments, after converting them to strings, to a file object (which defaults tosys.stdout
). But all expressions in Python produce a value, in this caseNone
is produced.This comment is hidden because it contains spoiler information about the solution
The test you claim you're getting does not and can not exist. A js number does not hold any information about leading zeros, it is of your own invention.
This one test did not get passed, so I decided to not go further and see the solution. Surprisingly, other solutions were the same as was mine, so not taking care of the leading 0 case. How come? Are the tests not the same for all?
No, it shouldn't, you're reversing the order, not doing this:
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
@lixiang2021 the numbers are guaranteed by the description to be 1 through 9
I think the answer is wrong, even though it can pass all tests.
Test.assert_equals(order("is2 Thi1s T4est 3a 11h"), "Thi1s is2 3a T4est 11h")
And the test result will be '11h Thi1s is2 3a T4est' should equal 'Thi1s is2 3a T4est 11h'. sorted(w) will put '11h' ahead of 'Thi1s', which is not we wanted.
sorted('11h') -> ['1', '1', 'h']
sorted('Thi1s') -> ['1', 'T', 'h', 'i', 's']
and, the second '1' in '11h' is less than 'T' in 'Thi1s', which is not we wanted.
This comment is hidden because it contains spoiler information about the solution
Brilliant!
Loading more items...