Discuss / Python / 求助，无法运算

### 求助，无法运算

Topic source

#### GhZicE-奇

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

Process finished with exit code 0

``````# -*- coding: utf-8 -*-

import math

a = float(input('Please input a'))
b = float(input('Please input b'))
c = float(input('Please input c'))

def quadratic(a, b, c):
print (quadratic(a, b, c))
if (a==0):
return 'value of a cannot be 0'
else :
derta = b**2 - 4*a*c
if (derta >= 0):
x1 = (-b + math.sqrt(derta))/(2*a)
x2 = (-b - math.sqrt(derta))/(2*a)
return x1, x2
else :
return 'Wrong Number!'
print (quadratic(a, b, c))
``````

#### GhZicE-奇

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

``````# -*- coding: utf-8 -*-

import math

a = float(input('Please input a'))
b = float(input('Please input b'))
c = float(input('Please input c'))

def quadratic(a, b, c):
if (a==0):
return 'value of a cannot be 0'
else :
derta = b**2 - 4*a*c
if (derta >= 0):
x1 = (-b + math.sqrt(derta))/(2*a)
x2 = (-b - math.sqrt(derta))/(2*a)
return x1, x2
else :
return 'Wrong Number!'

print (quadratic(a, b, c))
``````

• 1