title: python main() not executing in shell
body: <p>i am trying to run my flatten(li) function in main but its not running when i run the module. but when i type in "flatten(li)" in shell it is working. any ideas? thanks!</p>
  
  <pre><code>li = [0, 2, [[2, 3], 8, 100, None, [[None]]], -2]
  
  def flatten(li):
       i = 0
       while i &lt; len(li):
           "only execute if the element is a list"
           while isinstance(li[i], list):
               """taking the element at index i and sets it as the
                  i'th part of the list. so if l[i] contains a list
                  it is then unrolled or 'unlisted'"""
               li[i:i + 1] = li[i]
           i += 1
  
      for element in li:  
           if not element and not isinstance(element, int):
           li.remove(element)
  
      return li
  
  def main():
      flatten(li)
  
  if __name__ == '__main__':
      main()
  </code></pre>