I get this error:
"self.y = self.y * scale
NameError: name 'self' is not defined"
Is there a syntax error in this code, or is it a python compatibility issue? I'm using version 2.7, but this code is version 2.4 I believe. I though it was version 3 that was incompatible. Any idea why this code won't work? I thought 'self' was a built in thing.
class Shape: def __init__(self,x,y): self.x = x self.y = y description = "This shape has not been described yet" author = "Nobody has claimed to make this shape yet" def area(self): return self.x * self.y def perimeter(self): return 2 * self.x + 2 * self.y def describe(self,text): self.description = text def authorName(self,text): self.author = text def scaleSize(self,scale): self.x = self.x * scale self.y = self.y * scale