当我使用类对象调用显示函数时出现错误我应该怎么做才能克服这个问题?
class A:
def __init__(self, fname, lname, age):
self.fname = fname
self.lname = lname
self.age = age
def disply(self):
fp = open("abc","r")
for lines in fp:
temp = lines.split(", ")[-1]
fp.close()
print a
a = [A("Taylor","Launter",22), A("James","bond",40)]
a.display()