Created
May 27, 2020 01:22
-
-
Save Joelfranklin96/06cd318ee11ea77929fc298c42b81b6d to your computer and use it in GitHub Desktop.
magic methods
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def __add__(self,other): | |
result = guassian() | |
result.mean = self.mean + other.mean | |
result.stdev = math.sqrt((self.stdev)**2 + (other.stdev)**2) | |
return result | |
def __repr__(self): | |
return "mean {}, standard deviation {}".format(self.mean, self.stdev) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment