title: Python user input with fractions
body: <p>I am new programming and I am a bit stumped on this assignment. We are supposed to take user input of two fractions and get the product or quotient. We went over defining functions and I have those done but I am stumped on how to refer them to user input and vise-versa. Any pointers or clues would be appreciated, I just need some sort of epiphany I think. Here is my embarrassing code:</p>
  
  <pre><code>import fractions
  
  def gcd(m,n):
  
      while m%n != 0: #finds the GCD (global definition)
          oldm = m
          oldn = n
  
          m = oldn
          n = oldm%oldn
      return n
  
  class Fraction:
  
      def __init__(self,top,bottom): #constructor; creating fraction
  
          self.num = top      #methods to go about placing numerator and denominator
          self.den = bottom
  
      def __str__(self): #calling the fraction from methods above
          return str(self.num)+"/"+str(self.den) #Returns the value of fraction
  
  
      def __add__(self,otherfraction): #For addition of fractions (self = first fraction, otherfraction = second fraction)
  
          newnum = self.num*otherfraction.den + self.den*otherfraction.num
          newden = self.den * otherfraction.den
          common = gcd(newnum,newden)
  
          return Fraction(newnum//common,newden//common) #Returns the new fraction with reduced answer.
  
  
      def __mul__(self,otherfraction): #For multiplication of fractions
  
          newnum = self.num*otherfraction.num
          newden = self.den*otherfraction.den
          common = gcd(newnum,newden)
  
          return Fraction(newnum//common,newden//common)
  
  
      def __floordiv__(self,otherfraction): #For division of fractions; use // not /
  
          newnum = self.num*otherfraction.den #Use multiplication of the reciprocal
          newden = self.den*otherfraction.num
          common = gcd(newnum,newden)
  
          return Fraction(newnum//common,newden//common)
  
  
      def __sub__(self,otherfraction): #For subtraction of fractions
  
          newnum = self.num*otherfraction.den - self.den*otherfraction.num
          newden = self.den * otherfraction.den
          common = gcd(newnum,newden)
  
          return Fraction(newnum//common,newden//common)
  </code></pre>