Created
February 24, 2018 10:57
-
-
Save Nipun2016/dd78be58c6c632d30933f78c6268be8f 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 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