x1 = 1
d = 3
n = 100
x100 =x1+(n-1)*d
s =(x1+x100)*n/2
print s
d = 3
n = 100
x100 =x1+(n-1)*d
s =(x1+x100)*n/2
print s
2015-04-09
def quadratic_equation(a, b, c):
st = b*b-4*a*c
if st < 0:
return NONE
elif st == 0:
return -b / a / 2
st = math.sqrt(st)
return (-b + st)/a/2,(-b - st)/a/2
st = b*b-4*a*c
if st < 0:
return NONE
elif st == 0:
return -b / a / 2
st = math.sqrt(st)
return (-b + st)/a/2,(-b - st)/a/2
2015-04-09
L = [75, 92, 59, 68]
sum = 0.0
for name in L:
sum+=name
print sum / 4
sum = 0.0
for name in L:
sum+=name
print sum / 4
2015-04-08
print [x*100+y*10+z for x in range(1,10) for y in range(0,10) for z in range(0,10) if x==z]
2015-04-07