title: How to fix "AttributeError: type object has no attribute" in python?
body: <p>I am adding some code to the preset code to check the time availability, which is if the meeting time can fit into the proposed time schedule. However, I keep getting the following error. Can anyone please give me some advices? Thanks so much for your time. </p>
  
  <p>Preset codes:</p>
  
  <pre><code>from datetime import datetime
  class Meeting:
      def __init__(self, start_time, end_time):
          self.start_time = start_time
          self.end_time = end_time
  </code></pre>
  
  <p>My codes:</p>
  
  <pre><code>def check_availability(meetings, proposed_time): 
      meeting_start = Meeting.datetime.start_time.hour 
      meeting_end = Meeting.datetime.end_time.hour  
      ok_time = datetime.proposed_time.hour   
      if meeting_start &lt; ok_time &lt; meeting_end:
          return True 
      else:
          return False 
  
  meetings = [Meeting(datetime(2018, 8, 1, 9, 0, 0), datetime(2018, 8, 1, 11, 
  0, 0)), Meeting(datetime(2018, 8, 1, 15, 0, 0), datetime(2018, 8, 1, 16, 0, 
  0)), Meeting(datetime(2018, 8, 2, 9, 0, 0), datetime(2018, 8, 2, 10, 0, 0))]
  
  print(check_availability(meetings, datetime(2018, 8, 1, 12, 0, 0)))
  print(check_availability(meetings, datetime(2018, 8, 1, 10, 0, 0)))
  </code></pre>