Ad
  • Custom User Avatar

    I suspect you were mutating your inputs, so the resilts for the comparison calculation were not the same when replacement was disabled.
    An additional Python test had been added to check for mutation.

  • Default User Avatar

    Sounds similar to the problem below?

  • Custom User Avatar

    Sorry, I don't know that where is unclear? Could you tell me the details? Thanks ;-)

  • Custom User Avatar

    I see you found a working solution in the meantime :-)

  • Custom User Avatar

    It means that your passwords are not random "enough": it usually happens if you're not using the full character set (there is a check to see if all 26+26+10 characters are present); or you use a limited method, like "1 uppercase + 1 lowercase + random digits".

    For the later, the characters used in the generated passwords are counted, and if any character occurs more than 50% of the cases, then the test fails. Based on my tests, the normal appearance rate is around 35%, so there is quite a large margin.

    update: I updated the description with this info.

  • Custom User Avatar

    The testcases will automatically call the function with a different parameter. You don't need to manually call the function because the testcases will already do so. It gives an error because it looks for a variable 'n' and because it doesn't exist, it gives a name error. Just remove is_square(n) from your code.