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.
Your latest solution is wrong because
You use index to check positioning of the corresponding word to replace, this will fail if the
title
contains 2 or more identical space-separated words (same casing as well)You're checking whether word in
title
is also part of a sub-word inminor_words
instead of individual words thereYour code will compare numbers against itself (which fails for cases when
n = 0
) since the diff between a number and itself is always0
Someone already told me 2 years ago but thanks.
This is from the instruction.
Dayum.
In this kata, a difference seems to be defined as non-negative integer. So, there are no pairs when a negative n is given. And also, think carefully for n==0 case (e.g. lst=[1,1,1],n=0). When you want to check the input values, try to add a temporary code like "print(lst,n)"
yes, i am also having this issue. i don't know to pass test. because i don't know the problem with my code
oh haha, thanks!
I don't understand why every response he makes is so passive-aggressive. You'd think he hates to responding to people how he acts.
It simply doesn't exist there. You'd need to print
dict_scores
from the kata, then copy / paste it into your foreign environment.I'm confused, this isn't working in PyCharm because it doesn't know where the dict_scores variable is coming from.
I was just improving his code without changing it too much.
Please, don't post code in kumite's comments, it can't be marked as having spoiler content and are visible in the home page
`
def getCount(word):
print(len([current_letter for current_letter in word if current_letter.lower() in 'aeiou']))
getCount('Abracadabra')
`
Would run slightly faster as a list comprehension. Also, because strings are indexed by letter, "aeiou" doesn't need separate strings.
Loading more items...