Question: I was wondering how to convert a decimal into a fraction in its lowest form in Python.

For example:

```
0.25  -> 1/4
0.5   -> 1/2
1.25  -> 5/4
3     -> 3/1

```

Answer: 
```
from fractions import Fraction

print(Fraction(0.25))
print(Fraction(0.5))
print(Fraction(1.25))
print(Fraction(3))

#1/4
#1/2
#5/4
#3

```
One of the easiest way is to use `as_integer_ratio()` like this.

```js
b = 0.125

b.as_integer_ratio()

# Output as Tuple(1, 8).Numerator as 1 & Denominator as 8
```