title: How do I call a method from another method?
body: <p>I am coding a program in python. I introduce an entire number and the program gives back to me the decomposition in prime factors of this number.
  For example 6 ---> 3, 2. Another example 16 --> 2, 2, 2, 2.</p>
  
  <p>I am doing it with OOP. I have created a class (<code>PrimeFactors</code>) with 2 methods (<code>is_prime</code> and <code>prime_factor_decomposition</code>). The first method says wether the number is prime, and the second gives the decomposition back.</p>
  
  <p>This is the code:</p>
  
  <pre><code>class PrimeFactors(object):
      def __init__(self, number):
          self.number = number
  
      def is_prime(self):
          n = self.number - 1
          a = 0
          loop = True
  
          if self.number == 1 or self.number == 2:
              loop = False
  
          while n &gt;= 2 and loop:
              if self.number % n != 0:
                  n -= 1
              else:
                  a += 1
                  loop = False
          return a == 0
  
      def prime_factor_decomposition(self): 
          factors = [] 
          n = self.number - 1
          loop = True
  
          if PrimeFactors.is_prime(self.number):
              factors.append(self.number)
              loop = False
  
          while n &gt;= 2 and loop:
              if self.number % n == 0 and PrimeFactors.is_prime(n):
                  factors.append(n)
                  self.number = self.number / n
                  if self.number % n == 0:
                      n += 1
              n -= 1
          return factors
  
  s = PrimeFactors(37)
  print(s.is_prime())
  </code></pre>
  
  <p>I am getting a mistake. I think it is something related to the method call.
  My question is, How can I call a method from another method if they both are from the same class?</p>