title: Finding the biggest number for a sequence given by the while loop
body: <p>I'm currently learning Python, more specifically, how the loop while works. As far as I know, this loop can be used to create sequences of numbers with and specific condition. For example,</p>
  <pre><code>n=1
  
  while n &lt; 10:
      n = n*2
      print(n)
  </code></pre>
  <p>Which gives the powers of two up to 16:</p>
  <pre><code>2
  4
  8
  16
  </code></pre>
  <p>But I was wondering if there's a way for the loop to print only the biggest number of the sequence, in this case, it would be 16. Here's my attempt,</p>
  <pre><code>n=1
  bigNumber = 0
  while n &lt;= 10:
      bigNumber = n
      n = n*2
      if n &lt; bigNumber:
          print(bigNumber)
  </code></pre>
  <p>However it doesn't work. Could someone point out were the mistake is?</p>