Objective
With Fraction from the fractions module, operations with fractions are exact, without the rounding errors of float. The result comes already simplified.
Instructions
- The first line has the number
nof fractions; then one per line in the forma/b(or an integer). - Show the simplified sum. If it is not an integer, show its decimal value with 4 decimals on a second line.
3
1/2
1/3
1/6
1
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise