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.
It wont't handle punctuation, will it? If we pass "Stop Spinning My Words!" we won't get the name of the Kata as it's said in the description.
Your code gives us "Stop gninnipS My !sdroW".
Apart from that, it's very nice and clean solution.
Hi.
What is the point in creating new variable avg? You could just
return sum / array.length;
Regards
You are absolutely right.
My comment was about avoiding unnecessary 'else' statements.
Thanks for the 'anti-pattern', now I got a new word in my vocabulary.
Hi.
You don't need 'else' statement here. It would work like below:
if c == d:
return True
return False
It makes the code a bit cleaner (in my opinion).
Good luck!