title: While loop doesn't stop when number is power of 2
body: <p>I have some issues in python console app.
  I coded an factorization console app.
  It works well, but when I input a number that is power of 2 like 4, 8, 16, the while loop doesn't stop.
  So it doesn't print anything and the code doesn't stop.
  Bellow is my code.</p>
  <pre><code>import math
  
  n=input(&quot;Input check number:&quot;)
  n=int(n)
  sent= str(n) + &quot;=1&quot;
  
  for m in range(2, int(n / 2)+1):
      if n % m == 0:
          k = n
          i = 0
          while k % m == 0:
              k = k / m
              i += 1
          sent = sent + &quot;*&quot; + str(m) + &quot;^&quot; + str(i)
  
  if sent == str(n)+ &quot;=1&quot;:
      sent = sent + &quot;*&quot; + str(n)
  
  print(sent)
  </code></pre>
  <p>I want someone to help me.
  Thank you in advance.</p>