I'm not sure where to find the exact algorithm used by Python, but I hope this helps you. The easiest way to calculate a square root in Python is by using the ** (power) operator. I don't know how much work you have done with indices but square root is the same as putting something to the power of a half. So with that being true you could use:
print x**0.5
This prints the square root of whatever number you put in the place of x. Of course, if you are using Python 3 then you will need to write this as:
print(x**0.5)
That would be the easiest way to make an algorithm to calculate the square root of a number. This could be implemented in a function such as:
sqrt(x):
return x**0.5
For other roots such as cubic root etc, you could use a function like this:
root(x, root):
return x**root
And when you are passing the root number into the function use the numbers of the indices in decimal form, for example:
2: 0.5
3: 0.33333333 (recurring)
4: 0.25
5: 0.2
I hope you can see the pattern. I also hope this helped you some! :)