title: Python perfect number calculation
body: <p>I am having issues with calculating perfect numbers in python. Apparently the code is working in VBA so I am sure I am making some mistake in syntax / indentation. Please help!</p>
  
  <p>Here is my code:</p>
  
  <pre><code>Mynum=int(input("How many perfect numbers do you want?: "))
  
  counter=0
  k=0
  j=2
  i=1
  
  while counter&lt;Mynum:
      for i in range (1,j-1):
          if (j%i)==0:
              k=k+1
      if k==j:
          counter=counter+1
          print(i)
      k=0
      j=j+1
  </code></pre>