Ad
  • Custom User Avatar

    Not an issue, and lacking precisions.

  • Custom User Avatar

    The test is fine.

  • Default User Avatar

    It always works like that. Just add a print command as the first line of the function, which prints all incoming function parameters.

  • Default User Avatar

    Your code uses the floating point number division operator / instead of // for integer division since python version 3.
    In python versions 2.x / could mean integer division, but this has been changed incompatibly since version 3.
    You must calculate with integers only, not floats. Then it works.
    The problem is that floating point numbers have only limited precision, they can't store verly large integers.
    In python, integers can be as large as you want, but always divide using // to get an integer result.

  • Default User Avatar

    You could google "reducing fractions to same denominator".

  • Custom User Avatar

    the packets with at most 3 digits in this string 0 9026315 -827&()
    is 0 902 631 5 827 Who agree with me ?

    Cal the cubic of each digit and sum up all 0 737 244 125 863
    Then check sum only '0 Lucky'

    i beleive something wrong with test case
    please all help, it is nice kata but tooks me a while to figure it out :) .

  • Custom User Avatar

    See the example in the kata description:

     s = "aqdf&0#1xyz!22[153(777.777" 
       the groups of at most 3 digits are 0 and 1 (one digit), 22 (two digits), 153, 777, 777 (3 digits)
       Only 0, 1, 153 are cubic and their sum is 154
       Return: "0 1 153 154 Lucky"
               n1 ^  ^   ^
                  n2 n3 sum of n1 + n2 + n3
                     
    

    If there is only a single cubic number, the sum is the number itself.

  • Custom User Avatar

    why is the output "0 0 Lucky"

    "number1 number2 (and so on if necessary) sumOfCubicNumbers Lucky"

    The only hidden cubic number is 0, the sum is also 0.

  • Custom User Avatar

    The second 0 is sumOfCubicNumbers

    and then to make the sum of these "cubic" numbers found in the string

  • Custom User Avatar

    We search non-negative integer numbers, with at most 3 digits: here 0 must be considered a separated number (and it's a lucky one, obviously). Numbers are formed with consecutive digits (and then split in chunks of 3 if they are longer), so here you would have the following numbers: 0, 902, 631, 5 and 827.

  • Custom User Avatar

    Check two posts below yours. It says at most 3 digits, 0 is a single digit number and it is a hidden cubic number.

  • Custom User Avatar

    Just add print(lst) as the fist line of your function. It prints input of all tests and not the input of only failed tests, but you should focus on lines printed immediately before the red message, just like the article explains. Copy the test case into your IDE and debug your solution locally.

    If you have any problems with debugging your solution just paste your code here and someone could probably guide you further.

  • Custom User Avatar
  • Custom User Avatar

    You can read this paragraph to find out how to check inputs: https://docs.codewars.com/training/troubleshooting#print-input

    You can also raise a suggestion (or issue) about insufficient feedback from failed tests, so hopefully author improves tests so they give better information.

  • Default User Avatar

    Print the input.

  • Loading more items...