Ad
  • Custom User Avatar

    Yes, but description is shared amongst all languages and making a code block only for Python is not needed here, you can see false and False are booleans, and a string would have quotes around it. You can also check the sample tests when in doubt.

  • Default User Avatar

    I enjoyed this one, thank you. One small issue is that on the Python version, False is written as false with a lowercase f in the description. At first I was a bit confused, thinking maybe the tests were expecting us to return a string saying "false" if there was a problem with generating the hashtag. In other words True and False are capitalized in Python.

    Just a small quibble

  • Default User Avatar

    What an obtuse requirement

  • Default User Avatar

    That is what has happened to me. 114 correct, 1 incorrect. No idea what is wrong.
    e: There is an obtuse requirement for "vacuous truth", another comment goes into more detail.

  • Default User Avatar

    Thanks for that explanation, silly me.

  • Default User Avatar

    Hi - please don't use issue tag, that is reserved for problems with the kata itself, not problems with your code/debugging.

    I just solved in Python and it works fine. If you are sure you are failing on basic test #7, then that means you are failing on this input:

    [0,2,0,0,0,0,3,4,5,0,0,0,0,0]

    It's up to you to debug, but looking at your code: I recommend you re-read the first line of the description again to see if you are missing another condition for this kata.

    More generally, here's a very useful troubleshooting tip: you can always print the test input by adding the following line in your code:

    def zero_plentiful(arr):
        print(arr) ## <--- in this kata the input is called arr, replace by other name in other katas
        #rest of your code here
    

    now you can see the test cases you fail in the console. Hope that helps.

    You can read more about this here:

    https://docs.codewars.com/training/troubleshooting/#error-messages-and-printing-your-inputoutput

  • Custom User Avatar

    Help! i'm fail in Basic tests 7* (7 of 8 Assertions), a don't know where am i going wrong or what kind of input comes in test 7 that is breaking me.

  • Custom User Avatar

    I've just understood, thank

  • Custom User Avatar

    I know, but we have 2 sequences where zero appears 4 times in a row or more

  • Custom User Avatar

    What exactly should be fixed? The tests are fine.

    and every sequence of zeros is at least 4 items long.

    Your code is wrong. It returns 2 for this input: [0, 2, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 0, 0] The first 0 there is a sequence with only 1 element.

  • Custom User Avatar

    pls fix tests for Python

  • Custom User Avatar

    Read the description again.

    An array is called zero-plentiful if it contains multiple zeros, and every sequence of zeros is at least 4 items long.

    [0, 0, 0, 0, 0, 1]  -->  1
    [0, 0, 0, 0]  -->  1
    [0, 0, 0, 0, 0, 0, 0, 0]  -->  1
    

    Not a kata issue.

  • Default User Avatar

    Why are some of the test answers supposed to be 1 for Python? Surely any of the cases where there is only 1 string of 4 zeros should return 0?