AttributeError: 'str' object has no attribute 'spilt'
时间: 2023-09-15 15:21:52 浏览: 833
Python3下错误AttributeError: ‘dict’ object has no attribute’iteritems‘的分析与解决
5星 · 资源好评率100%
There is a typo in the code. The correct method name is 'split', not 'spilt'.
Replace:
```
string = "Hello world"
words = string.spilt()
```
with:
```
string = "Hello world"
words = string.split()
```
阅读全文