So I learned Python today after I picked up a quick tutorial at school... So I thought I ought to test my l33t0rz 20 minute 'skills' by converting my
C++ Fraction class, and I did!
Here is a code example:
Frac = Fraction(2, 4)
print Frac
Frac2 = Fraction(3, 4)
print Frac2
print Frac.add(Frac2)
print Frac.subtract(Frac2)
print Frac.multiply(Frac2)
print Frac.divide(Frac2)
print Frac.exp(3)
Would output:
1/2
3/4
5/4
1/-4
3/8
2/3
1/8
I think I might need to fix exp (Exponent) because, yeah, I don't think it is right, but correct me or prove me right that I am wrong (Weeee! Mind games

)
Anyways, you can download the class below. Enjoy, I suppose.