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 like the katana, but i missed some information for the "rules of scoring". I'm not familiar with tennis sport itself, but thanks to the katana i searched for some more information about counting in tennis. Maybe it would be nice to enhance the rules with:
A fourth point win by a player decides the game for him if the player then has a lead of at least two points, i.e. after the scores 40:0, 40:15 and 40:30 (or vice versa). If the score is 40:40, it is called a deuce. The following point is called an advantage.
Thanks for your help. I updated my code and now it is working. Now i also understand the test itself. You used the same list for a couple of tests, that's why my modification had this strong influence to the further tests. I'm sorry. I will keep this in mind for furhter katas.
Would you recommend to work always on a copy of the inputs?
Hi g964, i did what you said and printed the first element of ls with print(ls[0]).
I got this:
Traceback (most recent call last):
File "main.py", line 26, in
Test.assert_equals(choose_best_sum(880, 8, xs), 876)
File "/home/codewarrior/solution.py", line 2, in choose_best_sum
print(ls[0])
IndexError: list index out of range
Can you please check the tests, there must be something wrong.
greetings EScoder
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution