title: Time class, how to add Two time class appropriatly
body: <pre><code>class Time(object):
  
      def __init__(self,hour=0, minute= 0, second=0):
          if type(hour) != int or type(minute) != int or type(second) != int or hour &lt; 0 or hour &gt; 23 or minute &lt; 0 or minute &gt; 59 or second &lt; 0 or second &gt; 59:
              raise AssertionError
          self.hour = hour
          self.minute = minute 
          self.second = second
  
      def __add__(self,right):
          d = 0
          m = 0
          if type(right) != Time and type(right)!= int:
              raise TypeError
          if type(right) == int:
              self.second += right 
              if self.second &gt; 59:
                  d = self.second // 60
                  m = self.second % 60 
                  self.minute += d 
                  self.second = m 
                  if self.minute &gt; 59:
                      d = self.second // 60
                      m = self.second % 60
                      self.hour += d 
                      self.minute = m
                      if self.hour &gt; 23:
                          self.hour -= 12
          elif type(right) == Time:
              self.second = self.second + right.second
              if self.second &gt; 59:
                  d = self.second // 60
                  m = self.second % 60
                  self.minute += d 
                  self.second = m 
                  if self.minute &gt; 59:
                      d = self.second // 60
                      m = self.second % 60
                      self.hour += d 
                      self.minute = m
                      if self.hour &gt; 23:
                          self.hour -= 12
              self.minute = self.minute + right.minute 
              if self.minute &gt; 59:
                  d = self.minute // 60
                  m = self.second % 60
                  self.hour = self.hour + d 
                  self.minute = m 
                  if self.hour &gt; 23:
                      self.hour -= 12 
          return self
  </code></pre>
  
  <p>I am writing the + operator to allow adding a <code>Time</code> object and an <code>int</code>, producing a new <code>Time</code> object as a result. right can be either a time object or an integer. If it is an integer, it should be considered as second. Both <code>Time</code> + <code>int</code> and <code>int</code> + <code>Time</code> should be allowed and have the same meaning.</p>
  
  <p>As you can see, me code is a little bit messy. Also, it is not producing the correct result. see error as followed:</p>
  
  <pre><code>*Error: t+70 -&gt; 12:01:11am but should -&gt; 12:01:10am
  *Error: t+3600 -&gt; 12:11:11am but should -&gt; 1:00:00am
  *Error: t+86400 -&gt; 12:11:11am but should -&gt; 12:00:00am
  *Error: t -&gt; 12:11:11am but should -&gt; 12:00:00am
  *Error: Time(4,56,23)+500 -&gt; 4:43:43am but should -&gt; 5:04:43am
  *Error: Time(23,58,6)+736 -&gt; 11:22:22pm but should -&gt; 12:10:22am
  *Error: 1+t raised exception TypeError: unsupported operand type(s) for +: 'int' and 'Time'
  *Error: 70+t raised exception TypeError: unsupported operand type(s) for +: 'int' and 'Time'
  </code></pre>
  
  <p>Can someone help me to fix my code or tell me a better way so that I can simplify my code? Thanks in advance. </p>