想增加一个判断 可是不知道为什么错误了
>>> z='b*b-4ac'
>>> import math
>>> def qijie(a,b,c):
... t=math.sqrt(z)
... if z>=0:
... return(-b+t)/(2*a),(-b-t)/(2*a)
... else:
... print(error)
...
>>> print((qijie(1,5,9)))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in qijie
TypeError: must be real number, not str