SHARE
TWEET

Untitled

a guest Oct 14th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Dentist:
  2.    
  3.     def __init__(self, Day, Month, Year, Desc ):
  4.         self.day=Day
  5.         self.month=Month
  6.         self.year=Year
  7.         self.desc=Desc
  8.        
  9.     def printname(self):
  10.         return(self.day, self.month, self.date, self.desc)
  11.     def __str__(self):
  12.         return "Date: {}/{}/{} - Job: {}".format(self.day, self.month, self.year, self.desc)
  13.  
  14.              
  15.     #def time(self,day, month, year):
  16.         #if self.day == day and self.month==month and self.year==year:
  17.          #   return "There is an appointment on this date:"
  18.         #else:
  19.          #   return "There is no appointment on this date"
  20.  
  21.    
  22. class Day(Dentist):
  23.     def __init__(self, Day, Month,Year, Desc):
  24.         super().__init__(self, Day, Month, Year, Desc)
  25.  
  26.     def occurson1(self,Day):
  27.         if self.day == Day:
  28.             return True
  29.         else:
  30.             return False
  31.        
  32. class Month(Dentist):
  33.     def __init__(self, Day, Month,Year, Desc):
  34.         super().__init__(self, Day, Month, Year, Desc )
  35.  
  36.     def occurson2(self,Month):
  37.         if self.month==Month:
  38.             return True
  39.         else:
  40.             return False
  41. class Date(Dentist):
  42.     def __init__(self, Day, Month,Year, Desc):
  43.         super().__init__(Day, Month, Year, Desc)
  44.        
  45.     def occurson3(self, Day, Month,Year):
  46.         if self.day==Day and self.month==Month and self.year==Year:
  47.             return "There is an appointment on this date:"
  48.         else:
  49.             return "There is no appointment on this date"
  50.    
  51.  
  52. appt1=Dentist(14,2,2019,"Root")
  53. print(appt1.occurson1(2))
  54.  
  55.  
  56.  
  57. #we have a list of appointments
  58. #for each appointment we're going
  59. #depending on user input we're going to run
  60. #If occurson() is true store that day/date/month in a list
  61.  
  62.  
  63.  
  64. #appt_search=input("Please enter date to check Format example: 2005 5 10: ")
  65. #appt_exact=input("Would you like to check appointments on this Day, Month, or Date: ")
  66.  
  67. #date_split = appt_search.split()
  68. #day = date_split[2]
  69. #month = date_split[1]
  70. #year = date_split[0]
  71.  
  72. #if appt_exact == "Day" or "day":
  73.  #   appt1.occurson1(day)  
  74. #elif appt_exact == "Month" or "month":
  75.  #   appt1.occurson2(month)
  76. #elif appt_exact == "Date" or "date":
  77.  #   appt1.occurson(day, month, year)
  78. #else:
  79.  #   print("This was not an option")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top