import math
def quadratic_equation(a, b, c):
t=math.sqrt(b*b-4*a*c)
return (-b+t)/(2*a),(-b-t)/(2*a)
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
数学公式完全忘记了
def quadratic_equation(a, b, c):
t=math.sqrt(b*b-4*a*c)
return (-b+t)/(2*a),(-b-t)/(2*a)
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
数学公式完全忘记了
2014-12-24
if score <60:
return'<tr><td>%s</td><td style="color:red">%s</td></tr>' % (name, score)
else:
return '<tr><td>%s</td><td>%s</td></tr>' % (name, score)
return'<tr><td>%s</td><td style="color:red">%s</td></tr>' % (name, score)
else:
return '<tr><td>%s</td><td>%s</td></tr>' % (name, score)
2014-12-23
print [int(str(m)+str(n)+str(x)) for m in range(1,10) for n in range(0,10) for x in range(1,10) if m==x ]
2014-12-22