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'。

原因是什么?没看懂

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

阅读 4.2k
2 个回答

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

我运行了一次没有报错

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题