赞
踩
使用python3写代码执行时报错:
AttributeError: 'list' object has no attribute 'replace'
报错原因:
list对象没有replace方法,str对象才有,在list对象上调用replace当然会报AttributeError,
报错写法:
c=b.replace
修改正确:
c=str(b).replace
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。