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
d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59 }
def generate_tr(name, score):
if score >= 60:
return '<tr><td>%s</td><td>%s</td></tr>' % (name, score)
else:
return '<tr><td>%s</td><<td style="color:red">%s</td></tr>' % (name, score)
def generate_tr(name, score):
if score >= 60:
return '<tr><td>%s</td><td>%s</td></tr>' % (name, score)
else:
return '<tr><td>%s</td><<td style="color:red">%s</td></tr>' % (name, score)
2015-10-03
'''
#试试函数
def averDict(d = {}):
sum = 0
for i,v in d.iteritems():
print i,v
sum += v
print 'average', ':', float(sum)/len(d)
'''
#试试函数
def averDict(d = {}):
sum = 0
for i,v in d.iteritems():
print i,v
sum += v
print 'average', ':', float(sum)/len(d)
'''
2015-10-03
d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59, 'Paul': 74 }
sum = 0
for v in d.itervalues():
sum += v
print sum/(len(d))
sum = 0
for v in d.itervalues():
sum += v
print sum/(len(d))
2015-10-03
def firstCharUpper(s):
return s[0].upper()+s[1:]
print firstCharUpper('hello')
print firstCharUpper('sunday')
print firstCharUpper('september')
return s[0].upper()+s[1:]
print firstCharUpper('hello')
print firstCharUpper('sunday')
print firstCharUpper('september')
2015-10-03