Ad
  • Custom User Avatar

    fixed in OP's fork

  • Custom User Avatar

    Approved

  • Custom User Avatar

    python new test framework is required. updated in this fork

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    But it can easily be bypassed by setting the recursion limit to a higher value.

  • Custom User Avatar

    Well, the solution is probably 'right', but it seems a testcase has been added to make eval fail...

  • Custom User Avatar

    Not an issue. Your solution is wrong.

  • Default User Avatar

    last random test exit with this error
    Am I doing something wrong?

    Traceback (most recent call last):
    File "main.py", line 16, in
    test.assert_equals(sum_prod(strexp), oOSumProdOo__(strexp))
    File "/home/codewarrior/solution.py", line 3, in sum_prod
    return '{:.5e}'.format(eval(strexpression))
    RecursionError: maximum recursion depth exceeded during compilation

  • Custom User Avatar

    Fixed :)

  • Custom User Avatar

    This is known compatibility issue with the new runner we launched recently. https://github.com/Codewars/codewars.com/wiki/List-of-Affected-Kata

    I'll see if I can fix this soon.

  • Default User Avatar
    Traceback (most recent call last):
      File "main.py", line 15, in <module>
        strexp = __randexp__(Nfact)
    NameError: name '__randexp__' is not defined
    

    Fails on the last test with this message.

  • Custom User Avatar

    hi, can someone explain me why -->should equal '3.58000e+01'<--
    is the correct form?? i mean this is 358 so it cant be e+01 it is e+02 , no?

  • Custom User Avatar

    No problem, just trying to help out.

    I get the automatic PEP8 warnings in my editor using PyCharm (amongst other warnings) and it's kind of a game for me to try to write my code the first time without any warnings!

  • Default User Avatar

    Sure, good point.
    Thank you again

  • Custom User Avatar

    I don't think it's an official Codewars policy (I can't speak for them, I'm just a regular user) that all Python katas must abide by PEP8. But not only does it help to keep the Python katas consistent across the site, it can also help beginners to learn the correct way, the first time. Habits can be hard to break!

    There is a nice guideline written by @bkaes (ranked #8 overall) you could check out here:

    https://bkaestner.github.io/codewars-rules/

    2.3 Follow your language's naming conventions

    Every language has its quirks. Some of them get discussed in the later sections. However, there's one thing that should get mentioned at this point: make sure to use your language's proposed naming convention, if there exists one.

    This includes simple character cases like capitalized class names (almost all object oriented languages) or method names (CSharp), and whether a multi word function should be written with underscores (also called snake_case, e.g. my_awesome_function, Ruby, Python) or in camelCase (Haskell, JavaScript CoffeeScript).

    https://www.python.org/dev/peps/pep-0008/#naming-conventions

  • Loading more items...