title: Function to solve fractions does not work with negative numbers or zeros
body: <pre><code>def fraction(a=None, b=None):
      if a is None:
           a = int(input(&quot;Enter the value of a &quot;))
      if b is None:
           b = int(input(&quot;Enter the value of b &quot;))
      for i in range(1, min(a, b) + 1):
          if a % i == 0 and b % i == 0:
              gcf = i
      print(a//gcf, &quot;/&quot;, b//gcf)
  
  fraction()
  </code></pre>
  <p>I would like for this to add a negative number to the front of the fraction when 1 input is negative and have no change when both are negative. For 0's, if the denominator is 0 produce an output of &quot;invalid&quot; and if the numerator is 0 have an output of 0.</p>
  <p>However, my <code>i in range</code> is stopping this from happening. How could I try solving this issue?</p>