127k views
1 vote
Given that a function name f receives three parameters a, b, c, of type double, write some code, to be included as part of the function, that determines whether the value of "b squared" – 4ac is negative. If negative, the code prints out the message "no real solutions" and returns from the function.

1 Answer

1 vote

Answer:

def calculatereality(a,b,c):

if (pow(float(b),2) - 4*float(a)*float(c)) >=0:

print("real solutions")

else:

print("no real solutions")

calculatereality(12,234,12) #This is for output check

Step-by-step explanation:

The function required is written above. It prints imaginary or real values according to the calculations b^2-4*a*c.

User Nitwit
by
5.0k points