Im trying to subtract with prefixes as objects.

Here is my code

```
class Prefix:
def __init__(self, m=0, cm=0):
self.m = m
self.cm = cm
def __sub__(self, other):
centim = self.cm - other.cm
meter = (self.m - other.m) - abs(centim/100)
if meter < 1:
centim = m*100
meter = 0
return Prefix(meter, cm)
```

Im trying to subtract in a way which creates a negative centimeter value and take 1m from the meter object such that this is fulfilled

```
Prefix(2, 20) - Prefix(1, 30) == Prefix(0, 90)
```

First, keep in mind that for a given length, everything to the right of the hundreds place goes into

`cm`

, and everything at it or to its left gets divided by 100, and then goes into`m`

.Given this, we can recast the problem as converting both

`Prefix`

objects into their full lengths, performing calculations there, and then creating a new`Prefix`

from the result:Output:

Since we've come this far, we might as well store a "length" and overload

`__repr__`

to make the result prettier:Output: