Posted on | August 26, 2009 | 8 Comments
I am really beginning to like Python Programming Language. It is quite efficient in doing lot of tasks. Unfortunately, I don’t get to devote much time for learning it. Here is the code that will calculate the square root by newton method of iterations.
a = float(raw_input(“enter a integer”))
x = random.randint(1,a-1)
y = (x + a/x) / 2
if y == x:
x = y