运行以下代码时,我得到AttributeError: stat instance has no attribute 'printStats'
. 这里有什么问题?
class stat():
def __init__(self, fname, blocks, backEdges):
self.fname = fname
self.blocks = blocks
self.backEdges = backEdges
def printStats(self):
print self.fname + str(self.blocks) + str(self.backEdges)
element = stat("a", 1, 2)
element.printStats()