0
import math


def main():  
    loop=eval(input("How many times do you want to run the loop?" ))  
    x=eval(input("What number are you taking the square root of? "))  
    for i in range(loop):  
        x=guess  
        x/2=(guess+(x/guess))/2  
    print(guess)  

main()
3
  • x/2=(guess+(x/guess))/2 - what's this line supposed to do? Commented Sep 29, 2013 at 19:46
  • it is a math equation, that uses newtons method, to find square roots Commented Sep 29, 2013 at 19:49
  • 1
    I'm not asking about its purpose in general. I'm asking about what that line has to do with Python syntax. Commented Sep 29, 2013 at 19:50

1 Answer 1

1

Following line cause a syntax error:

x/2=(guess+(x/guess))/2 

Maybe typo of the following?

x = (guess+(x/guess))/2 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.