Discuss / Python / 交作业(看到题时候,我都没想起这个公式,看了以前的答案才想起来)

交作业(看到题时候,我都没想起这个公式,看了以前的答案才想起来)

Topic source
在此插入代码

import math def quadratic(a, b, c): d = b * 2 - 4 a* c if a== 0: return 'a no 0' if d < 0: return 'nono' else: x1 = (-b + math.sqrt(d)) / 2/a x2 = (-b - math.sqrt(d)) / 2/a return x1, x2


  • 1

Reply