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.
since the only place
result
is used is within the scope of the loop, there is no problemgood solver
I was attempting to use the sum module, but forgot the brackets lol. Nice to learn about return ending the function, that's useful!
quick question! how does it not give the error when we use result without initializing it?
"Notes:
our team always plays 10 matches in the championship
0 <= x <= 4
0 <= y <= 4"
No you aren't. For one, there is no global variable to modify because result is initialized and mutated inside of the function. Second, strings are immutable. This isn't modifying the string, its appending to a non-related list at specific slices of the string. . It is imperative code though, if that is what you meant. This can be written functionally but in this case, the imperative definitely seems more readable.
This is nice to read, but what if the score is double digits on either side? It is not in any of the tests I guess, but still...
Wow, you flattened the cr@p out of that list!
Another straightforward and concise code. I had two loops on mine which increased the run time. Nice one!
obviously like my solution
No,actually. after the first if statement becomes True (here 73>70), so the third if statement would be executed, and the return statement in if statement would throw the control out of the function. Hope that makes sense.
it is like my solution xd
why?
This is beautifully easy to read.
two ifs but no elif?!
Loading more items...