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 in minor_words instead of individual words there
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)"
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
This is from the instruction.
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
It simply doesn't exist there. You'd need to print
dict_scores
from the kata, then copy / paste it into your foreign environment.No, 256.1.2.3 is not valid
No, it isn't. Read the posts below as it was already explained more than once there.
100% sure it's a problem with your code. Are you printing the result or returning it?