0
I am generating number simplifications through the Fractions package.
All right until you find numbers where the simplification goes to the maximum, ie reducing one of the terms to "1".
When this happens the program omits this value, displaying only the other one. For example:
import fractions as F
print(F.Fraction(723520/51680))
Will generate the output 14
and not 14/1
how it should be and how the own documentation of the package shows that it was to occur. Example Fraction(123)
of documentation.
Thank you, Anderson. The result is generated as a type
list
, Right? In this case I needed to split and then strip to show only the numbers. It worked, but it didn’t get very Pythônico. No way to generate them in int? Thanks again– Evilmaax
@Max No, the result is a string. There’s a much easier way that I’ve added to the answer to access the numerator and denominator values as integers.
– Woss