Discuss / Python / 感觉修改的没问题 可是总是出错 求大神帮忙

感觉修改的没问题 可是总是出错 求大神帮忙

Topic source

天问一生

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

import math def quadratic(a,b,c): if not isinstance(a,(int,float)): raise TypeError('bad operand type(a)') if not isinstance(b,(int,float)): raise TypeError('bad operand type(b)') if not isinstance(c,(int,float)): raise TypeError('bad operand type(c)') if a==0: if b==0: return 'c=0' else: x=(-c)/b return x else: d=b*2-4ac if d<0: return '无实数解' else: x1=(-b+math.sqrt(d))/(2a) x2=(-b-moth.sqrt(d))/(2*a) return x1,x2

天问一生

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

有2*a 复制时系统漏掉了

天问一生

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

乘号都是有的 不知道粘贴完就有的没了


  • 1

Reply