Answered step by step
Verified Expert Solution
Link Copied!

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 -

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

Students also viewed these Databases questions