玩蛇网提供最新Python编程技术信息以及Python资源下载!

Python报错求助split method AttributeError不明白什么问题

# this program is used to catch the acronym

result = ''
inputdata = []

# input the phrase
inputdata = raw_input('please input the phrase ').upper().split()
for i in inputdata:
    result += i[0]
print result

#刚才随手删掉了 inputdata = []一行结果报错:
#AttributeError: 'builtin_function_or_method' object has no attribute 'split'。

原因是什么?没看懂

多谢...脑袋有点不清楚,可能确实是误操作了...

看你的报错,更像是不小心没有给upper的调用加上()

我运行了一次没有报错

玩蛇网文章,转载请注明出处和文章网址:https://www.iplaypy.com/wenda/wd18449.html

相关文章 Recommend

玩蛇网Python互助QQ群,欢迎加入-->: 106381465 玩蛇网Python新手群
修订日期:2017年06月15日 - 09时36分04秒 发布自玩蛇网

您现在的位置: 玩蛇网首页 > Python问题解答 > 正文内容
我要分享到:

必知PYTHON教程 Must Know PYTHON Tutorials

必知PYTHON模块 Must Know PYTHON Modules