python作业 提取出所有学生的序号,姓名,成绩, 敏感词过滤疫苗,疫情

python 提取出所有学生的序号,姓名,成绩

# 提取出所有学生的序号,姓名,成绩
str1='''<tbody>
<tr><td><span><span class="c-index c-index-hot1 c-gap-icon-right-small">1</span>张婷婷</span></td><td class="opr-toplist-right">92<i class="opr-toplist-st c-icon c-icon-down"></i></td></tr>
<tr><td><span><span class="c-index c-index-hot1 c-gap-icon-right-small">2</span>王华</span></td><td class="opr-toplist-right">91<i class="opr-toplist-st c-icon c-icon-down"></i></td></tr>
<tr><td><span><span class="c-index c-index-hot1 c-gap-icon-right-small">3</span>张岚</span></td><td class="opr-toplist-right">90<i class="opr-toplist-st c-icon c-icon-down"></i></td></tr>
<tr><td><span><span class="c-index c-gap-icon-right-small">4</span>孙鸿峰</span></td><td class="opr-toplist-right">90<i class="opr-toplist-st c-icon c-icon-down"></i></td></tr>
<tr><td><span><span class="c-index c-gap-icon-right-small">5</span>周海栋</span></td><td class="opr-toplist-right">89<i class="opr-toplist-st c-icon c-icon-down"></i></td></tr>
<tr><td><span><span class="c-index c-gap-icon-right-small">6</span>武静</span></td><td class="opr-toplist-right">88<i class="opr-toplist-st c-icon c-icon-down"></i></td></tr>
</tbody>'''
list1 = str1.split('</tr>', 5)
for i in list1:
    no_begin = i.find('c-gap-icon-right-small">') + len('c-gap-icon-right-small">')
    no_end = i.find('</span>')
    no = i[no_begin:no_end]
    print(no, end=' ')
    name_begin = no_end + len('</span>')
    name_end = i.rfind('</span>')
    name = i[name_begin:name_end]
    print(name, end=' ')
    score_begin = i.index('class="opr-toplist-right">')+len('class="opr-toplist-right">')
    score_end = i.index('<i class="opr-toplist-st c-icon c-icon-down">')
    score = i[score_begin:score_end]
    print(score, end=' ')
    print('')


python 敏感词过滤疫苗,疫情

我们国家新冠病毒疫苗接种的基本原则是“知情、同意、自愿”。接种人群的数量和群众接种意愿是直接相关的,所以在接种工作过程中我们一直在关注这个问题,也是接种工作的重点。我们一直在跟踪研究这个问题,根据现在了解的情况看,接种意愿受到的影响因素比较多,接种意愿变化也比较大。当前看,影响接种意愿的有两个主要因素:第一是疫情防控因素,我们国家目前采取了有力得当的疫情防控措施,所以我国的疫情总体平稳,部分群众就认为感染风险比较低,暂时不需要接种疫苗来增加保护力;第二是由于新冠病毒疫苗属于新上市疫苗,部分群众希望能够看到更多关于疫苗使用效果的信息,大家非常关注安全性、有效性等方面的数据,大家考虑对疫苗有更多了解之后再接种。当前主要是这两个方面因素有较大影响作用。

过滤敏感词:疫苗,疫情

# 敏感词过滤
str = "我们国家新冠病毒疫苗接种的基本原则是“知情、同意、自愿”。接种人群的数量和群众接种意愿是直接相关的,所以在接种工作过程中我们一直在关注这个问题,也是接种工作的重点。我们一直在跟踪研究这个问题,根据现在了解的情况看,接种意愿受到的影响因素比较多,接种意愿变化也比较大。当前看,影响接种意愿的有两个主要因素:第一是疫情防控因素,我们国家目前采取了有力得当的疫情防控措施,所以我国的疫情总体平稳,部分群众就认为感染风险比较低,暂时不需要接种疫苗来增加保护力;第二是由于新冠病毒疫苗属于新上市疫苗,部分群众希望能够看到更多关于疫苗使用效果的信息,大家非常关注安全性、有效性等方面的数据,大家考虑对疫苗有更多了解之后再接种。当前主要是这两个方面因素有较大影响作用。"
str1 = str.replace('疫苗', '**')
str2 = str1.replace('疫情', '**')
print(str2)

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

南蓬幽

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值