fork download
  1. print("For quadratic equation ax**2+bx+c=0, enter coefficients below")
  2. #For quadratic equation ax**2+bx+c=0, enter coefficients below
  3. a = int(input("Enter a:"))
  4. b = int(input("Enter b:"))
  5. c = int(input("Enter c:"))
  6.  
  7. if a==0:
  8. print("It won't be a quadratic, such a stupid you are")
  9. else:
  10. disc = b*b-4*a*c
  11. if disc == 0:
  12. root1 = -b/2a;
  13. print ("Roots are REAL and EQUAL")
  14. print ("The Roots are"root1"and" root1)
  15. elif disc > 0:
  16. root1 = -b-math.sqrt(disc))/(2*a);
  17. root2 = -b-math.sqrt(disc))/(2*a);
  18. print("Roots are REAL and UNEQUAL")
  19. print("The roots are"root1"and"root2)
  20. else:
  21. print("The roots are Imaginary and Complex")
  22. print("Go find them by yourselves, lazy chap!")
  23.  
  24.  
Compilation error #stdin compilation error #stdout 0.02s 9272KB
stdin
1,2,1
compilation info
Traceback (most recent call last):
  File "/usr/lib/python3.7/py_compile.py", line 143, in compile
    _optimize=optimize)
  File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "./prog.py", line 12
    root1 = -b/2a;
                ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.7/py_compile.py", line 147, in compile
    raise py_exc
py_compile.PyCompileError:   File "./prog.py", line 12
    root1 = -b/2a;
                ^
SyntaxError: invalid syntax

stdout
Standard output is empty