t = ('a', 'b', ['A', 'B'])
t = ('a', 'b', ('A', 'B'))
print t
直接这样真的好吗?
t = ('a', 'b', ('A', 'B'))
print t
直接这样真的好吗?
2015-10-20
def generate_tr(name, score):
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)
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)
2015-10-20
# 要这样才行
L = [95.5,85,59,59]
print L[0]
print L[1]
print L[2]
print L[3]
L = [95.5,85,59,59]
print L[0]
print L[1]
print L[2]
print L[3]
2015-10-20
L = ['Adam', 'Lisa', 'Paul', 'Bart']
L.pop()
L.pop()
print L
L.pop()
L.pop()
print L
2015-10-19
d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59, 'Paul': 74 }
sum = 0.0
for k, v in d.iteritems():
sum = sum + v
print k+":"+str(v)
print 'average', ':',sum/len(d)
sum = 0.0
for k, v in d.iteritems():
sum = sum + v
print k+":"+str(v)
print 'average', ':',sum/len(d)
2015-10-19