Sinisterly
Beginner Challenge | Quadratic formula Solver - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Python (https://sinister.li/Forum-Python)
+--- Thread: Beginner Challenge | Quadratic formula Solver (/Thread-Beginner-Challenge-Quadratic-formula-Solver)

Pages: 1 2 3


Beginner Challenge | Quadratic formula Solver - Adorapuff - 11-14-2013

Solve for x and takes input on a b and c.
[Image: Quadratic.formula.jpg]
Solution
Spoiler:
Code:
import math a = int(raw_input('Please input a: ')) b = int(raw_input('Please input b: ')) c = int(raw_input('Please input c: ')) print "x = " + str((b * -1 + math.sqrt(b**2 - 4*a*c))/ 2 * a) + ", " + str((b * -1 - math.sqrt(b**2 - 4*a*c))/ 2 * a)



RE: Beginner Challenge | Quadratic formula Solver - ねこまっしぐら - 11-15-2013

I can already almost solve a math equation with the quadratic formula.


RE: Beginner Challenge | Quadratic formula Solver - Oni - 11-15-2013

Not bad. I remember I used to hate the quadratic formula. Tongue


Beginner Challenge | Quadratic formula Solver - Adorapuff - 11-15-2013

(11-15-2013, 01:59 AM)Oni Wrote: Not bad. I remember I used to hate the quadratic formula. Tongue

What math are you taking right now? I hope to never have to see the formula again after high school. I made this just for some practice in Py as I'm brushing up on my skills for some autopwn code I'll release soon for SL eyes only.


RE: Beginner Challenge | Quadratic formula Solver - The_Joker - 11-16-2013

Importing "from math import sqrt" and then using sqrt instead of math.sqrt throws a "math domain" error. Any ideas why?
(Using python 2.7)


Beginner Challenge | Quadratic formula Solver - Adorapuff - 11-16-2013

(11-16-2013, 04:29 AM)The_Joker Wrote: Importing "from math import sqrt" and then using sqrt instead of math.sqrt throws a "math domain" error. Any ideas why?
(Using python 2.7)

You imputed incalculable numbers.


RE: Beginner Challenge | Quadratic formula Solver - Reiko - 11-16-2013

(11-15-2013, 02:03 AM)Putin Wrote: What math are you taking right now? I hope to never have to see the formula again after high school. I made this just for some practice in Py as I'm brushing up on my skills for some autopwn code I'll release soon for SL eyes only.
You will see it again in college, sadly.


RE: Beginner Challenge | Quadratic formula Solver - w00t - 11-16-2013

Only if your math requirement wasn't met in high school for some reason.


Beginner Challenge | Quadratic formula Solver - Adorapuff - 11-17-2013

I'll be done with Calc in HS.


RE: Beginner Challenge | Quadratic formula Solver - Colonel - 11-17-2013

(11-17-2013, 12:35 AM)Putin Wrote: I'll be done with Calc in HS.

Do you feel special? I finished Calc 2 in 11th grade, I had buddies who finished it in 9th grade, and the whole bunch still slays more poon than you..