Ad
  • Custom User Avatar

    This was a tough nut to crack, but very satisfying to complete.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Thank you again for your advice about reccursion, after taking a break I did some research which helped me understand where I went wrong and how to break out of the loop I created

  • Custom User Avatar

    Why do you say thet the recursive function is incomplete?

    edit: Okay, thank you for the help, it has been very informative, I was completely lost before

  • Custom User Avatar

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

  • Custom User Avatar

    Thats what I don't understand, how can the print statement be in the correct location, but when I replace it for a return statement that is not in the correct place. I didn't make this post to say that anything was wrong with the code, but to ask for help from more experienced programmers, because the code works when tested in visualcodestudio

  • Custom User Avatar

    As I said when I use return it shows the following:
    Test Results:
    thirt
    Basic tests
    None should equal 79
    None should equal 31
    None should equal 57
    None should equal 71
    None should equal 30

  • Custom User Avatar

    I changed it from return to print to see where where the error was occuring, but as I said, when I return the value it shows None instead of the values that would be printed and I do not understand why this is happeneing

  • Custom User Avatar

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

  • Custom User Avatar

    I have written a code that works in my IDE and prints out the correct values when I choose to print the values, as seen in my image, but when I return the values, it says None and errors out.
    Basic tests
    Log
    79
    None should equal 79
    Log
    31
    None should equal 31
    Log
    57
    None should equal 57
    Log
    71
    None should equal 71
    Log
    30
    None should equal 30

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Or is the approach I have taken to solve the problem wrong?

  • Custom User Avatar

    okay, but I use in-built mathematical functions and it still errors at e-12 or e-14, is there a way to solve this in python which would be able to complete all the problems efficiently whilst avoiding errors at e-14? or to add some leniency to the result parameters?

  • Loading more items...