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.
@VDSurChauffe well i agree now
nothing is cheating here as long as you don't use exploits
The sum function adds all of the elements in the list.
The input list is a list of 1's for every letter in the sentece if that letter is a vowel.
Therefore we sum all of those 1's together to get the number of vowels.
For example is inputStr is "abcdeabcde", then the list input into the sum function would be
[1, 1,1, 1]
So by summing it up we get sum([1,1,1,1]) = 1+1+1+1 = 4 vowels.
use spoiler flag when showing code (I have added the flag)
This comment is hidden because it contains spoiler information about the solution
Your solution is better!)
def idontunderstand:
return shame
In any respectable company you will get bashed for implementing a magic number that wasn't calculated inside of the code. Every person working on the project will have to spend additional time to understand & remember what this value corresponds to.
I don't agree. It's not best practice (despite the votes), but it's certainly not 'very bad' either. It's arguable if it's even 'bad', really, in this case.
Very bad practice, don't do this if you want a job in coding, lol.
first time seeing this method in action. brilliantly useful, this is why i love these communities.
good job
can you explain your solution?ty
Nice one!
cool. really cool.
Loading more items...