May-01-2021, 08:00 AM
All of your method names apart from
Example
__init__
, when called assign the method name to an attribute value.Example
class stats: def mode(self): # method name is mode self.mode = s.mode(self.value) # mode is now assigned as an attribute value return(self.mode) ... ...When
mode
is called the first time it works, but when it is called a second time it doesn't because it is now an int that can't be called.