Created
November 2, 2011 20:30
-
-
Save tomwolber/1334814 to your computer and use it in GitHub Desktop.
Fraction Shit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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