为何我的程序无法运行呢?
d={'liuyan':'男','yunxia':'女','xiaoyan':'女'}
def information_tr(name,sex):
if sex == '男':
return '<tr><td>%s</td><td style="color:red">%s</td></tr>' % (name,sex)
else:
return '<tr><td>%s</td><td>%s</td></tr>' % (name,sex)
tds=[information_tr(name,sex) for name,sex in d.iteritems()]
print '<table border="1">'
print '<tr><th>name</th><th>sex</th><tr>'
print '\n'.join(tds)
print '</table>'