I am using Python and fractions.Fraction()
I have a list of fractions that I want printed to look like this:
a = Fraction(0.25)
b = Fraction(1,3)
...
l = [a,b,...]
print(l)
>>>[1/4 , 1/3,...]
but instead I get:
a = Fraction(0.25)
b = Fraction(1,3)
...
l = [a,b,...]
print(l)
>>>[Fraction(1,4), Fraction(1,3),...]
I know I can get around this by iterating over the list I have and printing each element individually, but I wanted to know if there was an easier built in way before trying to do that.