Ad
  • Default User Avatar

    The error only occured in the tests. When I submited the code, it worked. Don't really know why, but it did.

  • Default User Avatar

    You passed the kata. The variable "c" is in your code "append(code[c:c+len_msg]" ?

  • Default User Avatar

    Getting this error in Python. Anyone know how to fix this? The variable in question is in the test, not in my code.

    Traceback (most recent call last):
    File "/workspace/default/.venv/lib/python3.11/site-packages/codewars_test/test_framework.py", line 112, in wrapper
    func()
    File "/workspace/default/tests.py", line 15, in tests1
    u = c
    ^
    NameError: name 'c' is not defined

  • Custom User Avatar
    total += points.get(score) 
    

    That line is in your code, isn't it? Read the error message:

    TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType' 
    

    Not a kata issue. Print the input to debug your code.

  • Default User Avatar

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

  • Default User Avatar

    name4 should not get +20 at the end

  • Custom User Avatar

    The question is not relevant. I figured out what's wrong.

  • Custom User Avatar

    array = [
    ["name1", 150, ["B", "A", "A", "C", "A", "A"]],
    ["name2", 120, ["B", "A", "A", "A"]],
    ["name3", 160, ["B", "A", "A", "A","A"]],
    ["name4", 140, ["B", "A", "A", "C", "A"]]
    ]
    name4 A3=303==90+B1=20+C1=10==120+20 (20) OF LENGTH WHY STILL IN OUTPUT?

  • Custom User Avatar

    It would not make sense if the tests for the task were displayed in more detail. And so, I'm at a loss as to what I did wrong. I originally found a solution, it passed the tests. I decided to do a little refactoring. After that, the new solution fails the tests.

  • Custom User Avatar

    Is there a point to this post?

  • Custom User Avatar

    more and all courses has a grade of b or above ;) kinda confused thnx

  • Custom User Avatar

    If there are 5 or more courses and all courses has a grade of B or above, additional 20 points are awarded.

  • Custom User Avatar

    can anyone explain me why name3 of sample cases not in output he scored 140 but actual score is 160

  • Default User Avatar

    oh thanks, got it

  • Custom User Avatar

    no one can get more than 200 points, it's just a rule. if you have more, it is "downgraded" to 200. so jack got 200 points

  • Loading more items...