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.
Good one with the prototype. but if the object will be created with the class, the prototype is created automatically.
Quite a very entry level kata, more stereotypical if I may say.
"[...] for 51 result should be 'Piecdziesiat jedno piwo poprosze'" - że co?
Incorrect resulst in test for numbers ended with 1 (according to Polish language):
F.e. for 51 result should be 'Piecdziesiat jedno piwo poprosze' not 'Piecdziesiat jeden piw poprosze'
No problem to make as tests wish but still
many thanks
I just added a quick fix so this shouldn't happen anymore. But it appears that you solved it already anyway :p
Many thanks - very helpful!
Oh yikes, the tests for Python are really bad: they crash on any error coming from your code (thinking you wrote a Translator class instead)
For sample tests, you can modify the tests. Change the
except
clause:With this you'll see that the mistake is on line 6:
if beers = 1
Your code uses the
translate
module, which is not installed on Codewars.When clicking test, I get a NameError thrown up for line 5 of the sample test code - "NameError: name 'Translator' is not defined".
How do I resolve this?
Yeah, I changed "Exception" to "RuntimeException" without "throws" and repaired one method. Now my code works and I finished it. Thanks for help :D
Thanks for reply. I will try to fix it then.
The tests basically expect you to throw a
RuntimeException
or its subclass. When you do this, the tests will pass, but you will still have one or two bugs to fix.The description should definitely mention what kind of exception is expected.
Maybe I'm just dumb but I can't pass "attempt" because of two test about throwing two different exceptions. If I did not throw that, I can't pass two test. If I throw exceptions as should be, I can't pass the rest of the tests.
Loading more items...