Discuss / Python / assignment

assignment

Topic source

黎晓缘梦

#1 Created at ... [Delete] [Delete and Lock User]
# -*- coding: utf-8 -*-
import math
def quadratic(a, b, c):
    x1 = (-b + math.sqrt(b*b - 4*a*c))/(2*a)
    x2 = (-b - math.sqrt(b*b - 4*a*c))/(2*a)
    if (b*b - 4*a*c) >= 0:
        return x1, x2
    else:
        return None

  • 1

Reply