As @Aurora001 mentioned, you should not ask for completed code. However, I think addressing the method you might use could be a good answer to your question, and I hope others agree. This is how I would approach the problem:
- Prompt for input to get the coefficients
a
,b
, andc
. - Write a method that finds the square root of a number (several algorithms exist and can be found with a Google search) – There are also more built-in ways to do exponentiation in Python without the math module but this seems like it is for a class and the point may be to see if you can write a
sqrt
implementation. - Write a method that uses your custom square root implementation to solve the quadratic equation using the coefficients as parameters.
- Test your two methods by doing a few test cases.
I hope this helps; post another question if you have more specific issues. I have noticed more people will be willing to assist if you generate your own code and ask about specific problems that you cannot solve.
solved Quadratic Formula without import math [closed]