Ad
  • Custom User Avatar

    Seems like your solution managed to pass in the end.

  • Default User Avatar

    while my solution has 70 lines lol
    still proud of myself though

  • Default User Avatar

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

  • Default User Avatar

    thats also me my 2nd acc

  • Custom User Avatar

    Assert::That(isValidWalk(V{'e','w','w','w','n','w','w'})

    There is no such test, and it should be false. (it could be one of random tests tho)

  • Default User Avatar

    aint that hard to be honest its just the author didnt explain well ..

  • Default User Avatar

    Hello im just so buffled and i didnt really get it i have my code now but the question has some points that didnt really explain clearly like this
    Assert::That(isValidWalk(V{'n','s','n','s','n','s','n','s','n','s'}) // it is true since the size is 10

    Assert::That(isValidWalk(V{'e','w','w','w','n','w','w'}) // SHOULD BE TRUE??? btw this is the input of the test .. how come this is true when every char is 1 min and this isnt even in 10 minutes just like the author said

  • Default User Avatar

    Hi, unless you can show some evidence that the kata is broken, please don't post as an issue, otherwise you can post as a question. In this case, the reason you get this error message is that the kata expects the funtion name to be likes, whereas your function name is digitize.

  • Default User Avatar

    I already tested my solution on a seperate ide and its succesful but when i copy and paste here i got this error. Pls Help :(

    Traceback (most recent call last):
    File "tests.py", line 2, in
    from solution import likes
    ImportError: cannot import name 'likes' from 'solution' (/workspace/default/solution.py)

  • Custom User Avatar

    This is where you need to start debugging your solution. The first step is to print the input, so even if you fail a test, you can see what the input for that test was. Then you can try to manually go over your code, step by step, to follow along with what it is doing. If you did, you would realize that your code never hits the return statement in some cases. This happens when return statements are buried in some conditional; if the conditional is never True, then the return statement is likewise never executed.
    Now, Python functions always return something. In the absence of a return statement, functions simply return None.

  • Default User Avatar

    Thank you for. Your help. I can almost get it now but there are still 6 error and strangely all of its is none should equal 2 and none should equal 1.. Can you atleast give me a hint whats wrong in my code?

  • Custom User Avatar

    Tests usually output something like "x should equal y", where x is your answer and y is the correct answer. Your code only returns a single number, and after hitting a return statement the function ends. Please look carefully at the test output. As I said before, your code will return q as soon as it encounters an odd number: if its_odd < 2: ..., which is true the first time c is odd.

  • Default User Avatar

    Oh sure so this is an example:
    [2,4,6,7]
    Output
    4 # this is the correct answer and i have no problem on this one but on finding the even number for example:
    [5,7,8]
    My output:
    1
    3

    Strangely there ie extra one i dont know how

  • Custom User Avatar

    I'm sorry but I don't quite understand what your problem is; could you copy and paste the exact input and test result?

  • Default User Avatar

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

  • Loading more items...