Question: 1 1 . 1 0 LAB: Quadratic formula Implement the quadratic _ formula ( ) function. The function takes 3 arguments, a , b ,
LAB: Quadratic formula Implement the quadraticformula function. The function takes arguments, a b and c and computes the two results of the quadratic formula: See Image The quadraticformula function returns the tuple x x Ex: When a b and c quadraticformula returns Code provided in main.py reads a single input line containing values for a b and c separated by spaces. Each input is converted to a float and passed to the quadraticformula function. Ex: If the input is: the output is: Solutions to xx x x SEE UPLOADED IMAGE for better view LAB: Quadratic formula Implement the quadraticformula function. The function takes arguments, a b and c and computes the two results of the quadratic formula:
xbb a c a; xbb a c a
The quadraticformula function returns the tuple x x Ex: When a b and c quadraticformula returns Code provided in main.py reads a single input line containing values for a b and c separated by spaces. Each input is converted to a float and passed to the quadraticformula function. Ex: If the input is:
the output is:
Solutions to x x; x ; x
main.py # Produces the roots of the given quadratic equation. # Does not consider overflow. Does not solve for imaginary roots. def quadraticformula a b c : # Check if the solution is imaginary if b a c : return None, None x b math sqrtb a c a x b math. sqrt b a c a return times times
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
