>>> #Note:- if you use 'from math import sqrt' you will get an error >>> #Example:- >>> from math import sqrt >>> a = float(input( 'Enter a: ' )) Enter a: 1 >>> b = float(input( 'Enter b: ' )) Enter b: 2 >>> c = float(input( 'Enter c: ' )) Enter c: 3 >>> # Using sol_1 = -b + sqrt(b**2 - 4*a*c) / 2*a >>> sol_1 = - b + sqrt(b ** 2 - 4 * a * c) / 2 * a Traceback (most recent call last): File "<pyshell#69>" , line 1 , in < module > sol_1 = - b + sqrt(b ** 2 - 4 * a * c) / 2 * a ValueError : math domain error >>> # Using sol_2 = -b - sqrt(b**2 - 4*a*c) / 2*a >>> sol_2 = - b - sqrt(b ** 2 - 4 * a * c) / 2 * a Traceback (most recent call last): File "<pyshell#71>" , line 1 , in < module > sol_2 = - b - sqrt(b ** 2 - 4 * a * c) / 2 * a ValueError : math domain error >>> >>> #Answer >>> print ( 'The Answer is {0} and {1}' . format(sol_1,sol_2)) Traceback (most recent call last): File "<pyshell#74>" , line 1 , in < module > print ( 'The Answer is {0} and {1}' . format(sol_1,sol_2)) NameError : name 'sol_1' is not defined >>>