Ad
  • Default User Avatar

    I think this is probably the best solution here as far as readability, but can you explain to me where the variables "w" and "s" are coming from. I'm still learning, and I don't see themm being called anywhere in the code prior to their use in the return statement. Additionally, if you don't mind explaining, why do you have '-' in front of 'w' in the return statement?

    I appreciate the help, thx!

  • Default User Avatar

    Ok, I can't understand this. My code (python) works in every single instance except for where the code is telling me it's supposed to be returning Matthew instead of Elizabeth. The system isn't reporting the test parameters to me, so my only assumption is that both numbers have the same weight, otherwise this wouldn't be an issue.

    Elizabeth has a total value of 97, Matthew has a total value of 97, if they're the top contenders and they're tied then Elizabeth needs to be returned, but the test keeps saying Matthew is the correct answer, and that's can't be right. This is the only test that's failing, can someone please help me understand what I'm missing here without referring me to the comments below? I've read them all, the solution isn't there.

  • Default User Avatar

    Had no idea you could chain those . calls, that would have made my solution a LOT simpler.

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    Good lord, I feel like an idiot. Ok, understood, and changed the one character that made the code not work. I appreciate you calling me out on that, best way to learn.

  • Default User Avatar

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

  • Default User Avatar

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