Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 7 Online
OpenStudy (anonymous):

Just started coursework and stuck on first exercise. "Positive root of the following equation: 34*x^2+68*x-510". I figured out that I can assign a number to X but is there a way to assign an open variable to X in order to run the equation (e.g. x = ?)?

OpenStudy (anonymous):

I have no idea what you are talking about I just started, so if you figure this out you might be able to help me

OpenStudy (anonymous):

which problem set are you referring to?

OpenStudy (anonymous):

Based strictly on your question, I think you are asking for an input for x? Basically, x=print("Give x a value:").

OpenStudy (anonymous):

He's referring to the 'Introduction to Python' handout that has a few problems in Python for you just to get you started using the language.

OpenStudy (anonymous):

um... are you sure your doing 6.00? the first pset is merely asking for input and printing it back out

OpenStudy (anonymous):

seriously, you shouldn't worry yourself over that problem. IT DOESNT MATTER!!!!!!!!! get on with the lectures and psets and you will learn everything you need to know in due time.

OpenStudy (anonymous):

import math print "a*x^2 + b*x + c = 0" a = float(raw_input("a = ")) b = float(raw_input("b = ")) c = float(raw_input("c = ")) x1 = ((-b + math.sqrt(b*b - 4*a*c))/(2*a)) x2 = ((-b - math.sqrt(b*b - 4*a*c))/(2*a)) print "x1 =", x1 print "x2 =", x2 Run as a module

OpenStudy (anonymous):

its simple...we know that roots of a equation can be found as [-b +or- sqrt(b^2 -4*ac)]/2ac.......solving which we get the roots as 3 and -5......simple...so i guess ur root must be 3.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!