title: TypeError: '>' not supported between instances of 'method' and 'int'
body: <p>I hoping someone can help with this.</p>
  
  <p>I have created a class with a function in it that counts the total cars in 4 lists of cars.</p>
  
  <p>On another script I am creating the interface and want to say if the answer to 'totalCars' is bigger than zero then proceed to offer a type of car.</p>
  
  <p>However when I do this I get this error: <code>TypeError: '&gt;' not supported between instances of 'method' and 'int'</code>. Here is the code:</p>
  
  <pre><code>def totalCars(self):
      p = len(self.getPetrolCars())
      e = len(self.getElectricCars())
      d = len(self.getDieselCars())
      h = len(self.getHybridCars())
      totalCars = int(p) + int(e) + int(d) + int(h)
      return totalCars 
  </code></pre>
  
  <p>And on the interface script have:</p>
  
  <pre><code>while self.totalCars &gt; 0:
  </code></pre>
  
  <p>To get around this I tried to use a boolean, like this: </p>
  
  <pre><code>def totalCars(self):
      p = len(self.getPetrolCars())
      e = len(self.getElectricCars())
      d = len(self.getDieselCars())
      h = len(self.getHybridCars())
      totalCars = int(p) + int(e) + int(d) + int(h)
      if totalCars &gt; 0:
          return True 
  </code></pre>
  
  <p>And on the app script I have:</p>
  
  <pre><code> while self.totalCars is True
  </code></pre>
  
  <p>But this totally crashed the program and won't run at all.</p>
  
  <p>Any guidance welcome here. 
  Many thanks.</p>