L = range(1, 101)
print L[0:10]
print [x for x in L if (x%3==0)]
print [x for x in L if x>=5 and x<=50 and (x%5==0)]
这个才是正确的
print L[0:10]
print [x for x in L if (x%3==0)]
print [x for x in L if x>=5 and x<=50 and (x%5==0)]
这个才是正确的
2015-10-06
L = range(1, 101)
print L[0:10]
print [x for x in L if (x%3==0)]
print [x for x in L if x>=5 or x<=50 if (x%5==0)]
print L[0:10]
print [x for x in L if (x%3==0)]
print [x for x in L if x>=5 or x<=50 if (x%5==0)]
2015-10-06
L = [95.5,85,59]
print L[0]
print L[1]
print L[2]
print L[2]
这样提交的确能得分,话说本来的提交答案是不是搞错了啊?
print L[0]
print L[1]
print L[2]
print L[2]
这样提交的确能得分,话说本来的提交答案是不是搞错了啊?
2015-10-05
print r'''"To be,or not to be":
that is the question.
Whether it's nobler in the mind to suffer.'''
that is the question.
Whether it's nobler in the mind to suffer.'''
2015-10-05
L=[75,92,59,68]
sum=0.0
for i in L:
sum=sum+i
print sum/len(L)
sum=0.0
for i in L:
sum=sum+i
print sum/len(L)
2015-10-04
print [m*100 + n*10 + m for m in range(1,10) for n in range(0,10)]
2015-10-04
print [str(m) + str(n) + str(l) for m in range(1,10) for n in range(0,10) for l in range(0,10) if m == l]
2015-10-03