<分区> 分区>
在 Python 2.7 解释器中,字符串拆分函数按预期工作:
>>> import string
>>> a = "a b c"
>>> string.split(a)
['a', 'b', 'c']
但是,在 Python 3.4.1 解释器中,我得到一个错误:
>>> import string
>>> a = "a b c"
>>> string.split(a)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'split'
知道我在这里遗漏了什么吗?
谢谢!
