- + - ac the ac part of the formula is called the discriminant--if it is positive there are two real rootsif it is zero there is one real rootand if it is negative there are two complex roots we will write program that accepts the aband factors from the user (with the and factors allowed to be )and then calculates and outputs the root or roots first we will look at sample runand then we will review the code quadratic py ax bx enter enter enter - - or - with factors - and the output (with some digits trimmedis - ( + jor (jthe output isn' quite as tidy as we' like--for examplerather than - it would be nicer to have xand we would prefer not to have any factors shown at all you will get the chance to fix these problems in the exercises now we will turn to the codewhich begins with three importsimport cmath import math import sys we need both the float and the complex math libraries since the square root functions for real and complex numbers are differentand we need sys for sys float_info epsilon which we need to compare floating-point numbers with we also need function that can get floating-point number from the userdef get_float(msgallow_zero) none while is nonetryx float(input(msg)if not allow_zero and abs(xsys float_info epsilonprint("zero is not allowed" none since the windows console has poor utf- supportthere are problems with couple of the characters ( and -that quadratic py uses we have provided quadratic_uni py which displays the correct symbols on linux and mac os xand alternatives (^ and ->on windows