title: comparing a number with a prefix in a class in python
body: <p>I am working on a small module. </p>
  
  <p>I have a class called pricelist. It contains the attributes prefix and price.</p>
  
  <pre><code>class pricelist:
      def setPrefix(self,prefix):
          self.prefix = prefix
      def setPrice(self,price):
          self.price = price
      def getPrefix(self):
          return self.prefix
      def getPrice(self):
          return self.price
      def getPrefixLength(self):
          return len(self.prefix)
  </code></pre>
  
  <p>I have created a list of pricelist objects. </p>
  
  <p>now i want to perform the operation, where when i give a phone number as input, i want to find prefix of the number and the corresponding price related to the prefix.</p>
  
  <p>Example:</p>
  
  <pre><code>prefix    price
  46        2.0
  44        3.0
  .
  .
  .
  .
  </code></pre>
  
  <p>when i give the input say "46 7223232323", it should return the price corresponding to it.
  I am new to python and python classess, so can you please help me out with the logic of this</p>