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

I am barely getting started and am on Exercise #2 at the bottom of the 'Getting Started' portion. Can someone show me how to execute this exercise or where to begin?

OpenStudy (anonymous):

Don't get discouraged, I think the majority of the difficulty of this may just be how recently you've covered this in math. These exercises are just meant to get you familiar with using python to do basic math processes. first, a root of an equation is another way of saying the zero crossing. so in this quadratic, you have 34*x^2 + 68*x - 510 and they give you the formula of a*x^2 + b*x +c and x1 = (-b + sqrt(b*b-4*a*c))/(2*a) so we know, and can enter: a = 34 b = 68 c = 510 then we are going to use sqrt which must be imported from math and then we can calculate it: import math x1 = (-b + math.sqrt( b*b - 4*a*c))/(2*a) Unfortunately, in their equation, the discriminant (b*b -4ac) is negative which results in imaginary number solutions. SHORT ANSWER you can't solve this problem for any real number. I recommend you just jump into the course as I'm sure you're interested in other things besides replacing your graphing calculator :)

OpenStudy (anonymous):

Thank you Jamrioking. I didn't think it would have anything to do with Python, but wanted to make sure I comb through every detail of instructions. But your short-answer really helps a lot b/c you're right - I'm not interested in any mathematical calculations.

OpenStudy (anonymous):

Yeah I couldn't do that quadratic equation solver script when I was simply a beginner. You should jump to the problem sets. As you do them and become more familiar with programming you will learn to do anything.

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!