Positive root of the following equation: 34*x^2 + 68*x - 510 Recall: a*x^2 + b*x + c x1 = ( - b + sqrt ( b*b - 4*a*c ) ) / ( 2*a ) Can anyone help to type this into the IDLE, so that i can find the root?
I did it pretty obvious way: import math a=34 b=68 c=-510 x=(-b+math.sqrt(b*b-4*a*c))/(2*a) print x
thanks a lot, but i copy and paste the instruction it said invalid syntax, can you teach me how to do that maths through the python?
I am sorry, but I'm just a beginner myself, this was the first thing I did with Python using instructions from the page http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/software/ and I posted it here because my code returns the correct answer to me. Maybe you have another version of Python. Sorry, I can't explain much at the moment as you see.
hey @sulphuratom it would be better if you paste your code and the error using any of the websites(eg www.pastebin.com , dpaste.com etc) it will help understand your problem better
Join our real-time social learning platform and learn together with your friends!