title: Why does the elif statement not apply when self.Input == 0 and the code stops appending "0" to self.binaryList?
body: <p>So I am relatively new to python and I am trying to build a Binary code converter. The code works fine until <code>self.Input == 0</code> and the elif statement seems not to get called. Genereally I have the problem that the last few 0 are not being appended to my self.binaryList after the last 1 in the binary code.</p>
  
  <pre><code>class BinaryCode:
      def __init__(self):
          self.twoSquaredList = [256, 126, 64, 32, 16, 8, 4, 2, 1]
          self.Input = int(input("Number to convert:"))
          self.binaryList = []
          self.x = 9
  
      def find_number_below_input(self):
          while self.x &gt; 0:
              for number in self.twoSquaredList:
                  if number &lt;= self.Input:
                      self.binaryList.append("1")
                      print(self.binaryList)
                      print(number,"number")
                      self.Input -= number
                      print(self.Input,"self.Input")
  
                  elif number &gt; self.Input and len(self.binaryList) &gt; 1:
                      self.binaryList.append("0")
  
          self.x -= 1
  </code></pre>
  
  <p>This is the output:</p>
  
  <pre><code>Number to convert:100
  ['1']
  64 number
  36 self.Input
  ['1', '1']
  32 number
  4 self.Input
  ['1', '1', '0', '0', '1']
  4 number
  0 self.Input
  </code></pre>