title: I am trying to filter out of a list for Mersenner prime but it is picking up empty values
body: <pre><code>k=2
  a=[]
  while((((2**k)-1))&lt;=upper):
  
      #using filter() to generate the list
      #in the form of 2^k-1
      result=filter(lambda x: x==((1&lt;&lt;k)-1),prime)
      a.append(list(result))
      k+=1
  </code></pre>
  <p>Please help me and let me know if I am doing anything wrong. I am currently new to Python so I do not have much knowledge.</p>