Let's make some python code to represent a decimal number as a fraction. This uses the mediant (which I had never heard of before) based on this @standupmaths video:
• Why do calculators get this wrong? (We don...
Here is my python code.
https://trinket.io/glowscript/c5bef3864e