[python] 关于python中的string.atoi()的问题

#!/usr/bin/python
#filename:string.py

import string

print  string.atoi(’13’,8)      #这里转换8进制的数
print string.atoi(’13’,16)     #这里转换成16进制的数

运行后的结果:
11
19    

>>> import string
>>> string.atoi(’13’,8)
11
>>> string.atoi(’13’,10)
13
>>> string.atoi(’13’)
13
>>>

  

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>