首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

Python 2.7 string.atoi命令的疑问,该如何处理

2012-03-29 
Python 2.7 string.atoi命令的疑问1 string.atoi( 10 )+4Traceback(mostrecentcalllast):File inter

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了么?

热点排行