Discuss / Python / 作业

作业

Topic source

独具一格5

#1 Created at ... [Delete] [Delete and Lock User]

import math

def quadratic(a,b,c): x1 = (-b-math.sqrt(bb-4ac))/(2a) x2 = (-b+math.sqrt(bb-4ac))/(2a) if bb-4a*c>=0: return(x1,x2) else: return('无解') print(quadratic(2,3,1)) print(quadratic(1,3,-4))


  • 1

Reply