0
Code not working
I am new to python. My code isn't displaying desired result import cmath a,b,c = 5,6,2 quadratic_formula = (-b+cmath.sqrt(b**2-4*a*c))/2*a print(quadratic_formula)
8 ответов
+ 8
What's the error that you are getting from the code you provided though?
+ 7
The code you provided runs fine from other online Python interpreters that I've tried. This for instance:
https://www.jdoodle.com/python-programming-online
+ 4
Yes you use math here. Oh wait I think you're good with C / C++ cuz cmath exists.
+ 3
@Hatsy
1) Use Python 3 docs.
2) I think cmath should exist, just that it needs to be pip-installed.
+ 1
Does math library work in the place of cmath? I am using PyCharm as IDE for python. It says math module doesn't exist.
+ 1
The online interpreters compute this result (-15+5j). Instead there should be a floating point value isn't it?
0
No error though. Blank
0
That's strange. Then it might be a problem in PyCharm