Ad
  • Custom User Avatar

    It fails when x = 1 because the b variable is set to x and a (a=0) + 1 is not less than b. This statement while a + 1 < b doesn't loop because 0 + 1 < 1 is not true. Therefore it doesn't loop and a (being 0) is returned. In is_sqrt(x) it squares the 0 that was returned in the other function and 0 is not equal to 1, meaning it returns false.

  • Custom User Avatar

    Always print the parameter you get so you know where you code is going wrong. It's probably not a bug since so many people have passed the Kata and it hasn't been reported before. If you're still confused, just reply to my comment with your code and I'd be happy to help you (make sure to press the spoiler button so others can't see).