Discuss / Python / 重新写的作业!

重新写的作业!

Topic source

单身旺2016

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

import math def quadratic(a, b, c): d = b b - 4 a c e = math.sqrt(d) x1 = (-b + e) / 2 a x2 = (-b - e) / 2 * a if a == 0: print('此方程无解!') else: return (x1, x2) print(quadratic(2, 3, 1)) print(quadratic(1, 3, -4))


  • 1

Reply