Ad
  • Custom User Avatar

    Hi Chrono - thank you very much. I understood the problem and you are right. appreciate your help.

  • Custom User Avatar

    Hi Chrono - thanks for the reply. sorry for posting multiple - it was not showing me when i first posted and i re-posted. i will make sure i dont do that.
    Below is my calling code to solve the problem:
    def equal_to_24(a,b,c,d):
    print(f"input is {a},{b},{c},{d}")
    if call24(a,b,c,d) is True:
    return '24'
    else:
    return "It's not possible!"

    i am printing the input and i see input displayed for all cases until the last step where it throws STDERR. I am showing last 2 cases output along with error at the end. hope this helps.

    Test Passed
    Log
    input is 4,3,1,6
    this one can return 6/(1-(3/4)), your answer is: 24
    input is 4,3,1,6
    Test Passed
    Log
    input is 1,1,1,1
    Test Passed
    Log
    input is 13,13,13,13
    Test Passed
    Log

    --------20 Random Test--------

    input is 21,28,21,53

    Test for: a=21,b=28,c=21,d=53 Example solution: "53-(28+(21/21))"
    STDERR
    Traceback (most recent call last):
    File "main.py", line 83, in
    A,B,C,D = filter(lambda x: len(x), re.split("[^\d.]+", useran))
    ValueError: not enough values to unpack (expected 4, got 1)

    I tested just for the last random case alone and i see its working
    Log
    input is 21,28,21,53
    this one can return 53 - (28 + (21 / 21)), your answer is: 24
    input is 21,28,21,53
    Test Passed

  • Custom User Avatar

    Can you fix this issue. All cases are passed but i see this STDERR while running random test cases.

    Traceback (most recent call last):
    File "main.py", line 83, in
    A,B,C,D = filter(lambda x: len(x), re.split("[^\d.]+", useran))
    ValueError: not enough values to unpack (expected 4, got 1)

  • Custom User Avatar

    to the author. can i get some help. i am getting issue with running random test case. all cases are fine but i see this error.

    Traceback (most recent call last):
    File "main.py", line 83, in
    A,B,C,D = filter(lambda x: len(x), re.split("[^\d.]+", useran))
    ValueError: not enough values to unpack (expected 4, got 1)

  • Custom User Avatar

    i am getting issue with running random test case. all cases are fine but i see this error

    Traceback (most recent call last):
    File "main.py", line 83, in
    A,B,C,D = filter(lambda x: len(x), re.split("[^\d.]+", useran))
    ValueError: not enough values to unpack (expected 4, got 1)

  • Custom User Avatar

    spent a lot of time on this. then realized my mistake . if this helps others -
    dont try to add number and reversenumber in the same iteration to the list or set.
    and no need to construct full set of size 65.

  • Custom User Avatar

    Thanks Nekai. that helps.

  • Custom User Avatar

    i started as beginner in python. I am at 8 kyu white. how do i know how many points should i make to move to yellow 6 kyu ? and does a problem show how many points it gives if you solve ?