Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Dentist:
- def __init__(self, Day, Month, Year, Desc ):
- self.day=Day
- self.month=Month
- self.year=Year
- self.desc=Desc
- def printname(self):
- return(self.day, self.month, self.date, self.desc)
- def __str__(self):
- return "Date: {}/{}/{} - Job: {}".format(self.day, self.month, self.year, self.desc)
- #def time(self,day, month, year):
- #if self.day == day and self.month==month and self.year==year:
- # return "There is an appointment on this date:"
- #else:
- # return "There is no appointment on this date"
- class Day(Dentist):
- def __init__(self, Day, Month,Year, Desc):
- super().__init__(self, Day, Month, Year, Desc)
- def occurson1(self,Day):
- if self.day == Day:
- return True
- else:
- return False
- class Month(Dentist):
- def __init__(self, Day, Month,Year, Desc):
- super().__init__(self, Day, Month, Year, Desc )
- def occurson2(self,Month):
- if self.month==Month:
- return True
- else:
- return False
- class Date(Dentist):
- def __init__(self, Day, Month,Year, Desc):
- super().__init__(Day, Month, Year, Desc)
- def occurson3(self, Day, Month,Year):
- if self.day==Day and self.month==Month and self.year==Year:
- return "There is an appointment on this date:"
- else:
- return "There is no appointment on this date"
- appt1=Dentist(14,2,2019,"Root")
- print(appt1.occurson1(2))
- #we have a list of appointments
- #for each appointment we're going
- #depending on user input we're going to run
- #If occurson() is true store that day/date/month in a list
- #appt_search=input("Please enter date to check Format example: 2005 5 10: ")
- #appt_exact=input("Would you like to check appointments on this Day, Month, or Date: ")
- #date_split = appt_search.split()
- #day = date_split[2]
- #month = date_split[1]
- #year = date_split[0]
- #if appt_exact == "Day" or "day":
- # appt1.occurson1(day)
- #elif appt_exact == "Month" or "month":
- # appt1.occurson2(month)
- #elif appt_exact == "Date" or "date":
- # appt1.occurson(day, month, year)
- #else:
- # print("This was not an option")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement