print r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.'''
Whether it's nobler in the mind to suffer.'''
2019-01-03
r可以不需要转义字符 \,''' '''不需要转义字符 \n
2019-01-01
d = {
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
print 'Adam'+':',d['Adam']
print 'Lisa'+':',d['Lisa']
print 'Bart'+':',d['Bart']
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
print 'Adam'+':',d['Adam']
print 'Lisa'+':',d['Lisa']
print 'Bart'+':',d['Bart']
2019-01-01
print [x*100+y*10+z for x in range(1,10) for y in range(10) for z in range(1,10) if x==z]
2018-12-29
d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59 }
def generate_tr(name, score):
return '<tr><td>%s</td><td style="color:red">%s</td></tr>' % (name, score)
tds = [generate_tr(name,score) for name, score in d.iteritems()]
def generate_tr(name, score):
return '<tr><td>%s</td><td style="color:red">%s</td></tr>' % (name, score)
tds = [generate_tr(name,score) for name, score in d.iteritems()]
2018-12-29