Question: def quadratic _ formula ( a , b , c ) : # Calculate the discriminant delta = b * * 2 - 4 *
def quadraticformulaa b c:
# Calculate the discriminant
delta bac
# Check if the discriminant is nonnegative
if delta :
# Calculate the two solutions using the quadratic formula
xb deltaa
xb deltaa
return x x
else:
# If discriminant is negative, return None
return None
# Read input values for a b and c
a b c mapfloat inputsplit
# Call quadraticformula function
solutions quadraticformulaa b c
# Print the solutions
if solutions is not None:
x x solutions
printfSolutions to axbx c
printfxx:f
printfxx:f
else:
printNo real solutions discriminant is negative
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
