Last active
December 12, 2015 12:39
-
-
Save jasonsperske/4773977 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import pow | |
from cmath import sqrt | |
print "Quadradtic Formula Calculator!!!" | |
print "Ax²+Bx+C=0" | |
print "This solve for x" | |
a = input("Please, enter value for A: ") | |
b = input("Please, enter value for B: ") | |
c = input("Please, enter value for C: ") | |
discriminant = sqrt(pow(b,2) - (4 * a * c)) | |
if discriminant.imag != 0: | |
print "discriminant is imaginary" | |
else: | |
print " Solution 1!!!:", (-b + discriminant.real) / (2 * a) | |
print " Soultion 2!!!:", (-b - discriminant.real) / (2 * a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment