Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 3: import math def quad(): a, b, c = [float(s) for sin input (Enter coefficient a, b, c: ).split(',')] discRoot = math.sqrt(b* b -
Question 3: import math def quad(): a, b, c = [float(s) for sin input ("Enter coefficient a, b, c: ").split(',')] discRoot = math.sqrt(b* b - 4* a * c) rootl = (-b + discRoot) / (2 * a) root2 = (-b - discRoot) / (2 * a) print(" The solutions are:", rootl, root2) quad() a) Choose the specific case of the following input a, b, c: * ValueError: math domain error (No real root) * rootl and root2 * "Invalid coefficient given *Something went wrong! * double root 2, 5, 1 0, 5, 1 > 1, 1, 1 1, 2,1 >b, 5, m b) Add instructions to obtain the program that checks to see what sort of error occurred: import math def quadratic(): print("This program finds the real solutions to a quadratic ") a, b, c = (float(s) for 3 in input ("Enter coefficient a, b, c: ").split('; ')] discRoot = math.sqrt(b* b - 4 * a * c) rootl = (-b + discRoot) / (2 * a) root2 = (-b - discRoot) / (2 * a) print(" The solutions are:", rooti, root2 ) IIIIII quadratic()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started