Skip to content

Instantly share code, notes, and snippets.

@Nipun2016
Created February 24, 2018 10:57
Show Gist options
  • Save Nipun2016/dd78be58c6c632d30933f78c6268be8f to your computer and use it in GitHub Desktop.
Save Nipun2016/dd78be58c6c632d30933f78c6268be8f to your computer and use it in GitHub Desktop.
class TimeSlots:
def __init__(self, time, price):
self.time = time
self.price = price
def __str__(self):
return "time|price : "+str(self.time)+"|"+str(self.price)
def __repr__(self):
return self.__str__()
def __hash__(self):
return (self.time, self.price)
def __eq__(self, other):
if self.time == other.time and self.price == other.price:
return True
else:
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment