我想知道如何在Python中将小数转换为最低形式的分数.
例如:
0.25 -> 1/4 0.5 -> 1/2 1.25 -> 5/4 3 -> 3/1
python decimal fractions
decimal ×1
fractions ×1
python ×1