title: Python - Bubble sort
body: <p>Hi I reviewed other posts with bubble sort, but solution didn't work in my case:
  So algorithm works until I repeat few times while loop. But how can I do this without using input? Here is my code so you know what I mean:</p>
  
  <pre><code>x = [0, 0, 1, 3, 3, 2, 2, 1, 0, 4, 5]
  
  h = None
  flag = True
  
  while flag == True:
      #flag = True
      for i in range(len(x) - 1):
          if x[i] &gt; x[i + 1]:
      #       flag = False
              h = x[i]
              x[i] = x[i + 1] 
              x[i + 1] = h
      print(x)        
  
      #input = raw_input('Satisfied? ')
      #if input == 'q':
      #   break
  
  print(x)
  '''
  we can replace variable h, with:
  x[i] , x[i+1] = x[i+1], x[i]
  '''
  </code></pre>