小编use*_*250的帖子

AttributeError:'str'对象没有属性'sub'Python代码

尝试学习即将到来的期末考试时出现此错误,需要了解它为什么不起作用.这是代码.

morning_agenda = "At 9.00AM the project team will assemble. The first topic will be fixing the bug in program product.py. We'll break for coffee at 10.30. Work will then continue on improving display.html until 12.30PM."

print morning_agenda

morning_agenda.sub('([0-9]+)\.([0-9]+)', r'\1:\2', morning_agenda)

print morning_agenda
Run Code Online (Sandbox Code Playgroud)

python regex attributeerror

3
推荐指数
1
解决办法
9286
查看次数

标签 统计

attributeerror ×1

python ×1

regex ×1