First of all, we should know how to solve the quadratic variance of one variable, and then write the program step by step. The equation is: ax^2 plus bx plus c equals 0. Write the simplest version first, except for the numerical value, and the calculation is successful. In fact, a very simple quadratic equation is solved. If the coefficients of the equation are changed, suppose that A is equal to 1, B is equal to 3, and C is equal to 5.
You will find that the program reported an error, involving the limitation of the math package. If it's a math bag, retelling won't work. The equation in this problem solves a complex number, so cmath is needed. Similarly, input a equals 1, b equals 3, and c equals 5. At this time, there is no error and the desired result is obtained. But if you use cmath, you will get an answer with J after entering an equation with a real number solution.
Introduction to python:
Python was designed by Guido van Rossum of the Netherlands Institute of Mathematics and Computer Science in the early 1990s as a substitute for a language called ABC. Python provides efficient high-level data structures and can also be used for simple and effective object-oriented programming.
2.Python syntax and dynamic types, as well as the nature of explanatory language, make it a programming language for writing scripts and developing applications quickly on most platforms.
3. With the continuous updating of the version and the addition of new language functions, it is gradually used for the development of independent large-scale projects. Python interpreters are easy to extend. You can use C or C++ (or other languages that can be called through C) to extend new functions and data types.
4.Python can also be used as an extended programming language in customizable software. Python's rich standard library provides source code or machine code suitable for all major system platforms.