title: adding two fractions in python
body: <p>I am trying to add two fractions in python</p>
  
  <p>if input 1/4 + 1/4, I am expecting 1/2 result</p>
  
  <p>I built a fraction class with an <code>__add__</code> method for addition</p>
  
  <pre><code>from fractions import gcd
  
  class fraction:
      def __init__(self, numerator, denominator):
          self.num = numerator
          self.deno = denominator
      def __add__(self, other):
          self.sumOfn = self.num + other.num
          self.sumOfd = gcd(self.deno,other.deno)
          return(self.sumOfn, self.sumOfd)
  
  
  
  print(fraction(1,4)+fraction(1,4))
  </code></pre>
  
  <p>However I am getting 2,4 as output, which is actually 1/2, just not simplified. How could I fix that problem ?</p>