读书人

Python 2.7 string.atoi命令的疑问,该

发布时间: 2012-03-29 12:53:12 作者: rapoo

Python 2.7 string.atoi命令的疑问
1
> > > string.atoi( '10 ') + 4
Traceback (most recent call last):
File " <interactive input> ", line 1, in <module>
NameError: name 'string ' is not defined


我按照 [征服PYTHON:语言基础与典型应用].孙广磊.完美书签.清晰PDF版
里原样写的代码,为什么是错误的。原书用的是Python 2.5

[解决办法]
import string了么?

读书人网 >perl python

热点推荐