I am new to python programming and i am working on a project.

I have a list with prefix and price. Its look like this

```
LIST 1                   LIST2
prefix      price         prefix     price
44          5.7           44         3.5
45          3.8           45         5.6
678         4             78         1.0
6543        2             6543       1.5
12          8

```

and so on...

I have the above one in a class object.

The input is the phone numbers. I can give a phone number "4673345677" or "6543346874" and i have to find the cheapest price for the given number. One other condition is that, if a number satisfies several prefixes the longest prefix should be used.

This is the structure of the python class i am working on:

```
class CallPrice:
    def __init__(self,prefix,price):
        self.prefix = prefix
        self.price = price

    def getPrefixLength(self):
        return len(self.prefix)

```

I tried to split the input phone number and compare the prefix, but my logic fails. Can anyone please help me out with this logic or point me in the right direction?