Created
August 6, 2020 20:22
-
-
Save tugloo1/3b811611664173e813b44d936f2ba569 to your computer and use it in GitHub Desktop.
This file contains 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
class BloodPressureDataPoint(object): | |
def __init__(self, systole, diastole, hr): | |
self.systole = systole | |
self.diastole = diastole | |
self.hr = hr | |
print("finished initializing") | |
def __lt__(self, other): | |
print("running less than comparison") | |
return self.systole < other.systole | |
def __gt__(self, other): | |
print("running greater than comparison") | |
return self.systole > other.systole | |
first = BloodPressureDataPoint(121, 78, 80) | |
second = BloodPressureDataPoint(140, 90, 85) | |
print(first > second) | |
print(second < first) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment