← Back to challenges

Divide a Fraction by Two

PythonHardmathnumbers

Instructions

Create a function that takes a number as an argument and returns half of it.

Examples

half_a_fraction("1/2") ➞ "1/4"

half_a_fraction("6/8") ➞ "3/8"

half_a_fraction("3/8") ➞ "3/16"

Notes

Always return the simplified fraction.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Merge Lists in Order