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.
Python:
I'm raising the error on the right moment, when lives == 0. I've tried:
raise Error('Omae wa mo shindeiru')
raise ValueError('Omae wa mo shindeiru')
raise Exception('Omae wa mo shindeiru')
None of this seems to work. What am I missing?
For Python making the method a static method is not required!!!
Also there should be a better explanation about the standard output. People think return also prints.
For 8 Kyu let it be a bit more educational. Now it is more like a trick question and judging from the responses everybody is gets just pissed of by it.
allow people to succeed, don't set them up to fail.
Okay, three months later now.
I finally solved it. Anyone struggling: Google 'swap in place python'. If you tried args[::-1] you are thinking too advanced.
It appears a 'return' function is not required. This puzzled me.
You sure you fixed it? This is wat the interpreter gives back to me. How is this wrong?
Test Results:
Log
args = [1, 2]
sgra = [2, 1]
[1, 2] should equal [2, 1]
Even if I give it [2, 1,] typed by hand, it still says it is wrong.
Python:
There is a typo in the description. It says 'create a function named (...???...) that calls' The name of the function is missing. I figured it out, but this could have been potentially very frustrating and it not the skill you want to test from your users at 8 kyu level.
So, almost trew my computer out of the window. 'set' in Python 3 scrambles the letters differently everytime I run it. For Python 2 it is stable. And I finally know where the order is coming from.
This problem should be limtited to Python 2 only.
For python:
Test case and description is wrong. Resulting dictionary starts with 'a' and ' ' and I couldn't figure out why. When I click attempt all test cases follow the order of the appearance of the characters in the message.
Mmm... this should not have worked.
Ints and floats work by accident.
Hi,
I was working on this kata and when I finally found a solution (return ''.join(c for c in s if c not in badc)). In the solutions screen i saw that some users solved this kata with (return s.translate(None, badc)). That was annoying. I used that exact solution! However it gave me an error saying that the translate command would take only 1 argument, not 2.
After trying a little and also recalling that I read it somewhere I found out that the second solution does not work for Python 3, but does for Python 2.
!!!! - Suggestion: name/show/mention the Python version for the particular solution in the solutions screen. - !!!!
Thank you very much!
What about Exit codes? Also 0?
How do you know whether it will pick 1 or 10?
Does the first element always correspond with False and the second with True?
Oh I fell for it. Damn!
Solved it though!
Love this kata!!! More like this please!
The formula could have been shown though...
Made an error on the lbs. for the conversion factor of F that I used I wrote 0.3048e-2. It had to be 0.3048**(-2).
This comment is hidden because it contains spoiler information about the solution