Skip to content

Instantly share code, notes, and snippets.

@Joelfranklin96
Created May 27, 2020 01:22
Show Gist options
  • Save Joelfranklin96/06cd318ee11ea77929fc298c42b81b6d to your computer and use it in GitHub Desktop.
Save Joelfranklin96/06cd318ee11ea77929fc298c42b81b6d to your computer and use it in GitHub Desktop.
magic methods
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