> > > import string
> > > string.atoi( '10 ') + 4
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
string.atoi('10') + 4
AttributeError: 'module' object has no attribute 'atoi'
我按照 [征服PYTHON:语言基础与典型应用].孙广磊.完美书签.清晰PDF版
里原样写的代码,为什么是错误的。原书用的是Python 2.5
------解决方案--------------------
好垃圾的书。
- Python code
int('10') + 4
------解决方案--------------------
这啥书啊
atoi一看就是c/c++转过来的
python讲的是简洁,直接int(str)和str(int)互相转来转去多方便
------解决方案--------------------
python3没有向下兼容,你要使用python3的话需要看python3的书