The problem is that you expect ans ** root == abs(num)
to be true. That is not likely, as floating point arithmetics work with a limited precision. Take a look at that:
>>> import math
>>> math.sqrt(7)
2.6457513110645907
>>> math.sqrt(7)**2
7.000000000000001
>>> math.sqrt(7)**2 == 7
False
You should change your success condition. For example:
acceptable_error = 0.000001
if abs(ans ** root - abs(num)) <= acceptable_error):
# success
Not that the if your linear search takes big steps, acceptable_error
must be big too.
As to the binary search, you should have something like:
while abs(ans ** root - abs(num)) > acceptable_error):
...