TypeError:'float'对象在Python中没有属性'__getitem__'

时间:2017-01-30 16:03:52

标签: python python-2.7

我正在使用Python开发一个项目。我是初学者,在运行程序时遇到此错误。

Traceback (most recent call last):
  File "E:/Python/1616/checkProfile.py", line 104, in <module>
    p.getResults()
  File "E:\Python\1616\Profile.py", line 67, in getResults
    for i in range(2): self._s[1]  += e.getS[1]
TypeError: 'float' object has no attribute '__getitem__'


Error in Line 67

http://pastebin.com/HXvppfmU

1 个答案:

答案 0 :(得分:0)

检查数据类型允许的方法是什么,

[Authorize(Roles="Administrators")]
[Authorize(Users="DOMAIN\User")]
public ActionResult SecureArea()
{
    ViewBag.Message = "This is a secure area.";
    return View();
}

尝试发布你的代码。