Skip to content

Instantly share code, notes, and snippets.

@tomwolber
Created November 2, 2011 20:30
Show Gist options
  • Save tomwolber/1334814 to your computer and use it in GitHub Desktop.
Save tomwolber/1334814 to your computer and use it in GitHub Desktop.
Fraction Shit
from fractions import Fraction
def fraz(r1,t1,r2,t2):
z = Fraction(r1,t1) + Fraction(r2,t2)
n = z.numerator/z.denominator
return n
if __name__ == "__main__":
print fraz(10,5,6,2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment