为了账号安全,请及时绑定邮箱和手机立即绑定

为什么没有红啊

d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59 }

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)


tds = [generate_tr (name, score) for name, score in d.iteritems()]

print '<table border="1">'

print '<tr><th>Name</th><th>Score</th><tr>'

print '\n'.join(tds)

print '</table>'


正在回答

1 回答

python中不显示红色,在html中会显示

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
初识Python
  • 参与学习       758362    人
  • 解答问题       8967    个

学python入门视频教程,让你快速入门并能编写简单的Python程序

进入课程

为什么没有红啊

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号