Could you please let me know where I am going wrong?
For example, for [True,True, True] and False, my answer was False because ,as in the example in the instructions, (p ⊻ q) ⊻ r = True , so the single boolean of “False” is False. Thank you.
My code fails in many of the tests but I find it impossible to work out what is wrong.
This is a simple example:
'abaaa baabb' should equal 'abaaa baabb'
How can that be wrong?
Replies to previous questions indicate that, for example, the answer for {0,0,0,0,1,0,0,0} should be 0 because "every group of zeros has to be at least 4 items long" Could you please explain why the first four zeros are not considered to be a group of 4?
The first value in that error message is what your function returned, not the input value. There are several open issues below for Python, tho. Check mrtp0's one.
The instructions say:
“When inserted, the copied elements overwrite others...”
So how can the following be correct,please? The length of the second list is less than the original
Problem solved!
Thank you very much for your help.
What will be your log if
m=''
?Try
print(repr(s), repr(m))
.Thank you for your reply.
However, this is the log I retrieved:
Log
['Mars', 'Earth', 'Neptune', 'Asteroid', 'Venus']
The second parameter ("") does not seem to have been entered.
The problem is with your solution. It fails following test case:
test.assert_equals(is_planet_mnemonic_correct(["Mars", "Earth", "Neptune", "Asteroid", "Venus"], ""), False)
One of the tests omits the second parameter, which causes an error to be thrown. Can this be corrected, please?
When the parameter
is_exclusive
isFalse
, it means the list should be evaluated as:True or True or True
, which is clearlyTrue
:PCould you please let me know where I am going wrong?
For example, for [True,True, True] and False, my answer was False because ,as in the example in the instructions, (p ⊻ q) ⊻ r = True , so the single boolean of “False” is False. Thank you.
No problem! I'm glad it worked out :)
Thank you very much for your advice. There was indeed a trailing space.
My code fails in many of the tests but I find it impossible to work out what is wrong.
This is a simple example:
'abaaa baabb' should equal 'abaaa baabb'
How can that be wrong?
A very nice Kata to (re)learn a very useful build-in package.
With that my first idea shrunk to basically 2 lines.
but the second group is not. if there is ANY group of less than 4 zeroes, then the array is NOT 0-plentiful, and you should return 0.
If EVERY group of zeros is of length >= 4, then you return the number of such groups.
Replies to previous questions indicate that, for example, the answer for {0,0,0,0,1,0,0,0} should be 0 because "every group of zeros has to be at least 4 items long" Could you please explain why the first four zeros are not considered to be a group of 4?
The first value in that error message is what your function returned, not the input value. There are several open issues below for Python, tho. Check mrtp0's one.
The instructions say:
“When inserted, the copied elements overwrite others...”
So how can the following be correct,please? The length of the second list is less than the original
[ 7, 'r', 'y', 's', 'm', 'x', 'f', 1, 5, 5, 'v', 'j', 'i', 'g', 'h', 2, 'g', 1, 0, 4, 'o', 2, 'r'] should equal [7, 'r', 1, 5, 5, 'v', 'j', 'i', 'g', 'h', 2, 'g', 1, 0, 4, 'o', 2, 'r']
Loading more items...