Ad
  • Custom User Avatar

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

  • Custom User Avatar

    Whoops. You're right. In every situation it makes more sense to not import sqr. I was getting confused for some reason. Nevermind.

  • Custom User Avatar

    Why would you use sqrt instead of ** in production? Exponent operation is quicker (because a module doesn't need to be imported); it's shorter; a module doesn't unnecessarily need to be imported and you can use exponent operation for nth roots. Apologies, I have no experience in industrial coding, so I'm just curious.

  • Custom User Avatar

    I like this one. It's using the simplest terms, while just as short as the solution that imports sqrt.

    In production it would make sense to import sqrt, but given that this is an exercise where you're meant to learn, this method is the best.